If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Operation must use an updateable query Error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-02-02, 10:58
Philby_Walsh Philby_Walsh is offline
Registered User
 
Join Date: Nov 2002
Posts: 13
Operation must use an updateable query Error

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query -

/bsci99/pwalsh/Add Records ASP/addrecordsql2.asp, line 20

I am gettin this error while trying to run a simple ASP page to insert records into a DB...

anyone know where im going wrong..?

this is the relevent line of code:

20 - conn.execute(strSQL)
21 - conn.close
22 - set conn = nothing
Reply With Quote
  #2 (permalink)  
Old 12-02-02, 15:38
JonathanB JonathanB is offline
Registered User
 
Join Date: Feb 2002
Location: North Wales, UK
Posts: 114
Please post the actual database connection code your using and the query that the page is trying to run.
__________________
J^ - web | email
newsASP Developer
Reply With Quote
  #3 (permalink)  
Old 12-02-02, 16:08
brandonh6k brandonh6k is offline
Registered User
 
Join Date: Nov 2002
Posts: 11
Without seeing the actual code like Jonathan asked for, I'm betting it's a permissions issue.

Make sure that the IUSR_<machinename> account has Write permissions to your Access Database file (since it's probably outside the web site).

Hope this helps...
__________________
- Brandon
Reply With Quote
  #4 (permalink)  
Old 12-03-02, 06:25
Philby_Walsh Philby_Walsh is offline
Registered User
 
Join Date: Nov 2002
Posts: 13
Here is the actual connection code & SQL code:

Code:
<%@ Language = "VBScript"%>
<%
'Declare all local variables
dim conn
dim rs
dim strconn
dim strsql

strsql = ""
'set connection string to local variable-I use a DSN-less connection
strconn = "DRIVER={Microsoft Access Driver (*.mdb)};
DBQ=" & Server.MapPath("adoandsqladd.mdb");

'build the sql statement based on the input from the form
strSQL = "INSERT INTO tblSqlAdd(FirstName, LastName, FavoriteColor) Values('" & request("FirstName") & "', '" & request("LastName") & "', '" & request("Favoritecolor") & "')"

'Set connection object 
set conn = server.createobject("adodb.connection")
conn.open strconn
'Use the execute method of the connection object the insert the record
conn.execute(strSQL)
conn.close
set conn = nothing
%>
Hopes this gives you guys a better idea of my problem,
Philby
Reply With Quote
  #5 (permalink)  
Old 12-03-02, 11:29
brandonh6k brandonh6k is offline
Registered User
 
Join Date: Nov 2002
Posts: 11
The code looks right to me...

Do you have access to the server? If so, check the permissions on the database. Open Windows Explorer, go to the database file, right-click it, select Properties and then click on the permissions tab. In the top box, you should see a user named IUSR_... Click it and then look at the checkboxes at the bottom. Make sure that the Write box is checked. If you don't see an IUSR_ account, the server is probably using the Everyone group to access the file, so you'll need to add IUSR_ to the list. Click Add then select IUSR from the list. Make sure that you give IUSR_ read and write access (should be the same as Everyone, plus the Write checkbox).

Hope this helps...
__________________
- Brandon
Reply With Quote
  #6 (permalink)  
Old 12-03-02, 13:36
Philby_Walsh Philby_Walsh is offline
Registered User
 
Join Date: Nov 2002
Posts: 13
hey brandon,

I've done that (and converted the DB to Access 2002 from '97) but no I have this error:

Code:
Microsoft VBScript compilation error '800a0409' 

Unterminated string constant 

/bsci99/pwalsh/Add Records ASP/addrecordsql2.asp, line 16 

strconn = "DRIVER={Microsoft Access Driver (*.mdb)};
god...if it isnt one thing its another!!
Reply With Quote
  #7 (permalink)  
Old 12-03-02, 15:11
Bruce A. Baasch Bruce A. Baasch is offline
Registered User
 
Join Date: Nov 2002
Location: Ohio
Posts: 90
If DBQ=" starts on the next line

...shouldn't it have a continuation character on the previous line?
__________________
Bruce Baasch
Reply With Quote
  #8 (permalink)  
Old 12-03-02, 15:22
brandonh6k brandonh6k is offline
Registered User
 
Join Date: Nov 2002
Posts: 11
Yep. You're missing some quotes...

It should look like this...

Code:
...
strconn = "DRIVER={Microsoft Access Driver (*.mdb)};" &_
          "DBQ=" & Server.MapPath("adoandsqladd.mdb") & ";"
...
The &_ is a continuation character for VBScript strings (meaning use the stuff on the next line too).

Give this a try...
__________________
- Brandon
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On