Welcome to WebmasterWorld Guest from 54.145.209.34

Forum Moderators: ocean10000

Database INSERT INTO problems

   
7:06 pm on Feb 9, 2006 (gmt 0)

10+ Year Member



I am receiving the following error when I try to insert a new row into my test database

Microsoft JET Database Engine error '80004005'

Operation must use an updateable query.

I don't know if my syntax is correct. A fairly easy task is getting harder and harder it seems! Don't they always though? Here is my syntax .. I am just learning ASP and SQL, so please go easy on me!


Set DataConnect = Server.CreateObject("ADODB.Connection")
DataConnect.Provider = "Microsoft.Jet.OLEDB.4.0;"
DataConnect.Properties("Jet OLEDB:Database Password") = "******"
DataConnect.Open "Data Source=D:.../.../test.mdb;"


sSQL = "insert into test (busName, contact_fn, contact_ln, address, city) values ('" & busName & "', '" & contact_fn & "', '" & contact_ln & "', '" & address & "', '" & city & "')"
DataConnect.execute(sSQL)
DataConnect.Close
Set DataConnect = Nothing

It's hard to troubleshoot when you are learning a new language. And all I have to go by are these books that have examples that can't be applied to real-world coding and provide no assistance in troubleshooting when it doesn't work. Live and learn is the best way anyway I figure.

Thank you for any input you might have!

-- Zak

9:39 pm on Feb 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your database probably doesn't have write permissions for the IUSR account.
10:00 pm on Feb 9, 2006 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



What happens if you just try to read from the database, is that sucesfull?
10:17 pm on Feb 9, 2006 (gmt 0)

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member



in access you can't have the design view open while doing updates.

also, check your syntax of things like dates, etc.

1:01 am on Feb 10, 2006 (gmt 0)

10+ Year Member



Operation must use an updateable query.

Sounds like permissions to me.
10:29 am on Feb 10, 2006 (gmt 0)

10+ Year Member



i have the same problem and my database have no particular setting as permissions...

i noticed that i have two different errors changing the database connenction instructions. In detail:

1.
set conn=Server.CreateObject("ADODB.Connection")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="& Server.Mappath("/data/databaseName.mdb")
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.

2.
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/Inetpub/wwwroot/data/databaseName.mdb"
Error type
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/AgipKCOOLQR/Module/AgipKCO-OLQR-ModuleInsert.asp, line 64

If someone have any suggestions!

Thanks

6:11 pm on Feb 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need to grant write access to the folder that the database in for the user account that IIS runs under when executing the asp code, typically IUSR_MACHINE.
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month