Hey,
The below "INSERT INTO" code used to work fine with my Win98 computer running Personal Web Server. Now I've ported it to a WinXP Pro computer running IIS and get the following error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/MySite/MyScript.asp, line 18
Here is the code:
<%
Dim sql, connection, dsn
ID = Request.Form("txtID"
Name = Request.Form("txtName"
Age = Request.Form("txtAge"
sql = ""
sql = sql & "INSERT INTO MyTable (id, name, age)"
sql = sql & "VALUES ('"& ID &"', '"& Name &"', '"& Age &"');"
Set connection = Server.CreateObject("ADODB.Connection"
dsn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("MyDatabase.mdb"
connection.Open dsn
connection.Execute(sql) ' This is the error line 18
connection.Close
Set connection = Nothing
response.redirect("thanks.asp"
%>
Thank you,
karmafree.
The below "INSERT INTO" code used to work fine with my Win98 computer running Personal Web Server. Now I've ported it to a WinXP Pro computer running IIS and get the following error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/MySite/MyScript.asp, line 18
Here is the code:
<%
Dim sql, connection, dsn
ID = Request.Form("txtID"
Name = Request.Form("txtName"
Age = Request.Form("txtAge"
sql = ""
sql = sql & "INSERT INTO MyTable (id, name, age)"
sql = sql & "VALUES ('"& ID &"', '"& Name &"', '"& Age &"');"
Set connection = Server.CreateObject("ADODB.Connection"
dsn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("MyDatabase.mdb"
connection.Open dsn
connection.Execute(sql) ' This is the error line 18
connection.Close
Set connection = Nothing
response.redirect("thanks.asp"
%>
Thank you,
karmafree.