|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
cannot change access database
I'm having problems using the "update" command of the recordset object. I can read from the database perfectly, but I can't write to it.
The following code is just a sample of my whole code (but it uses the same logic): <%@LANGUAGE="VBSCRIPT"%> <%Option Explicit%> <!--#include file="adovbs.inc"--> <% dim connstr,data,rs, sqlcmd, conn set conn = server.CreateObject("ADODB.Connection") conn.connectionString = "DSN=student" conn.open set rs = server.createobject("ADODB.RecordSet") connstr = "SELECT * FROM info" rs.Open connstr, conn, 2, adLockOptimistic, adCmdText rs.moveFirst response.Write(rs("name")) rs("name") = "Neil" response.Write(rs("name")) rs.update response.Write(rs("name")) %> I get the following message when I try to use it: Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC Microsoft Access Driver] Cannot update. Database or object is read-only. I checked to see whether the database or table was "read-only" - but they're not. In addition, I checked on ODBC and I used the "Microsoft Access Driver," which should be correct. Can anybody tell me what I did wrong? Why can't I do anything to change the database table? |
|
#2
|
|||
|
|||
|
More than likely the user account that the web server is operating under doesn't have write permissions to the .mdb file.
Since you're using a DSN and ODBC, it's possibly a permissions issue with the ODBC section of the registry, or the TEMP folder (ODBC and Access causes IIS to use the TEMP folder in windows) It's possible that the dynamic cursor you're using isn't updateable. You might try using a static cursor. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > cannot change access database |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|