Извините слишком много вопросов, чтобы посмотреть через. Мой код:ADODB.Connection # 424: Требуемый объект
Function GetConnection(ByVal Server, ByVal Database, ByVal UserID, ByVal Password)
Dim conn
On Error Resume Next
Set conn = Server.CreateObject("ADODB.Connection")
If Err.Number <> 0 Then
Set conn = Nothing
Response.Write "#" & Err.Number & ": " & Err.Description
Response.End
Exit Function
End If
CONST connStringFormat = "Provider=SQLOLEDB.1;[email protected];Persist Security Info=True;User [email protected];Initial [email protected];Data [email protected]"
Dim myConnectionString
myConnectionString = Replace(Replace(Replace(Replace(connStringFormat, "@Server", Server), "@Database", Database), "@UserID", UserID), "@Password", Password)
conn.Open myConnectionString
On Error GoTo 0
Set GetConnection = conn
End Function
Возвращается ошибка, как показано на моей веб-странице:
# 424: Требуется объект
Любые идеи, что является причиной этого? Пожалуйста, проигнорируйте тот факт, что я не проверяю правильность подключения к точке, потому что она бомбит в заявлении Server.CreateObject("...")
!
Если вы показали [mcve] это помогло бы в данный момент вы не показываете, как вы используя 'GetConnection()' в вашем коде, чтобы создать экземпляр объекта ADODB.Connection. – Lankymart