English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am developing an ASP page for web site. I am using ADO to connect to my Access database. When I open ADO.Connection it always opens in ReadOnly mode and doesn't update the tables and gives message "OPERATION MUST USE UPDATEABLE QUERY". I am using ConnectionMode=3 or 16 but when I see the ConnectionMode in properties system shows that ConnectionMmode=1. If I use the same ADO.Connection command in Visual Basic it works and update the table but in ASP it doesn't work. I am using IIS (Internet Information Server 5.1). and my database is Microsoft Access. Please help me out.

2006-07-14 06:21:16 · 2 answers · asked by Qadeer S 1 in Computers & Internet Programming & Design

My mdb file is not read only and the same code is working in Visual basic. I have a table with the name "Staff" and a field in it with the name FullName. My Query is "Update Staff set FullName='Qadeer'". It works in VB but doesn't in ASP. I have copied all my ASP project into another computer with same IIS version and same MS Access version and it works fine but in my computer the connection object opens the database in readonly mode

2006-07-14 07:03:28 · update #1

Dear BOB:
I am writing the same code as mentioned by you but still its not working it establishes the connection in ReadOnly mode

Dim strSQL
strSQL = "select * from Table WHERE ID > 10"
Dim ObjConn, ObjRec
Set ObjConn = Server.CreateObject("ADODB.Con...
Set ObjRec = Server.CreateObject("ADODB.Rec...
ObjConn.Open [some_connection_string]
ObjRec.Open strSQL, ObjConn, adOpenKeyset, adCmdText

2006-07-15 20:58:22 · update #2

2 answers

There are a few things you have to do to update a database in Access:

1, Don't query an Access query. Query the tables directly with SQL language calls, i.e.

Dim strSQL
strSQL = "select * from Table WHERE ID > 10"
Dim ObjConn, ObjRec
Set ObjConn = Server.CreateObject("ADODB.Connection")
Set ObjRec = Server.CreateObject("ADODB.Recordset")
ObjConn.Open [some_connection_string]
ObjRec.Open strSQL, ObjConn, adOpenKeyset, adCmdText

...also, make sure you are opening the recordset with a locktype like adOpenKeyset that permits updating....

2006-07-14 07:11:44 · answer #1 · answered by evolver 6 · 0 0

Is your database (.mdb file) set to read-only?

What is your query?

[EDIT]
Does your IIS user have access to the directory that the mdb file is in? Check the permissions in the IUSR_YourAdmin user account. Don't worry about setting a ConnectionMode value either.

2006-07-14 06:39:25 · answer #2 · answered by Kryzchek 4 · 0 0

fedest.com, questions and answers