PDA

View Full Version : Problem Inserting Records in Access from ASP


gregsim
03-06-2001, 01:12 PM
What is wrong with the following code. I am not able to insert records:

'Insert total donation amount into the donations table.
strSQL="INSERT INTO donations (total) VALUES (total)"
objConn.Execute(strSQL)

yields the following error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
/jaars/getpost.asp, line 31

Here is my connection:

set objConn = server.CreateObject("ADODB.Connection")
strConnect="Driver={Microsoft Access Driver (*.mdb)};DBQ="&server.mappath("Jaars1.mdb")
objConn.Open strConnect

gregsim
03-07-2001, 11:57 AM
Well, somebody gave me the fix - I had used the wrong format. The following works.

strSQL="INSERT INTO donations (total) VALUES (" & total & ")"