I am trying to update a record in the DB with the connection.execute method and I get this error everytime.
Microsoft VBScript runtime error '800a01a8'
Object required: '[string: "Provider=Microsoft.J"]'
/GetData.asp, line 78
I have a recordset to which I have made changes. The connection is opened at the top of the asp with a call to GetConn, then the record is displayed and changes can be made on the form. When the user clicks save this same asp is called and it falls through to the this code.
This call to GetConn seen here has just been added because I thought I was loosing the connection somehere, but I still get the same error. This is GetConn
[code=vb]
Function GetConn()
Dim cnxtion
set cnxtion=Server.CreateObject("ADODB.Connection")
cnxtion.Provider="Microsoft.Jet.OLEDB.4.0"
cnxtion.Open(Server.MapPath("/database/website.mdb"))
GetConn=cnxtion
Set cnxtion=nothing
End Function
[/code]
Why is the error occuring?
Thanks for you help,
Microsoft VBScript runtime error '800a01a8'
Object required: '[string: "Provider=Microsoft.J"]'
/GetData.asp, line 78
I have a recordset to which I have made changes. The connection is opened at the top of the asp with a call to GetConn, then the record is displayed and changes can be made on the form. When the user clicks save this same asp is called and it falls through to the this code.
Code:
Case "Save" SQL="UPDATE " & session("curtbl") & " SET " for each fld in RS.Fields If right(fld.Name, 2)<>"ID" Then SQL=SQL & fld.name & "='" If Request.Form(fld.name)="" Then SQL=SQL & fld.value & "'," Else SQL=SQL & Request.Form(fld.name) & "'," End If End If next SQL=LEFT(SQL, len(SQL)-1) & " WHERE " & session("Key") Response.Write(SQL) Set cnxn=GetConn cnxn.Execute SQL
[code=vb]
Function GetConn()
Dim cnxtion
set cnxtion=Server.CreateObject("ADODB.Connection")
cnxtion.Provider="Microsoft.Jet.OLEDB.4.0"
cnxtion.Open(Server.MapPath("/database/website.mdb"))
GetConn=cnxtion
Set cnxtion=nothing
End Function
[/code]
Why is the error occuring?
Thanks for you help,
Comment