View Full Version : Two parameter MSAccess query USING JAVASCRIPT

07-30-2007, 03:02 PM
I want to run a SQL query stored in Microsoft Access with 2 parameters from an ASP page.

It works with one parameter... but says the following code with two parameters:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'.

/papers/maths/checkSubject.asp, line 9

I have written the following code into the ASP page:

adoRecordSet = adoConnection.Execute("GetSUBQList "+Session('SIDSS') + Session("subject"));

Both the parameters are the Sessions.

Does anyone know the right syntax?
Can I please have it in ASP JavaScript? :)

07-30-2007, 03:09 PM
Javascript is client side only. It cannot "speak" to your SQL server or MSAccess database.

What is the SQL query on line 9 that you are trying to run (If it's the above code on your .Execute statement, what does GetSUBQList in your Stored Procedure say?)?

Basically, your query is malformed.

07-30-2007, 08:29 PM
if the 2 session values are your parameters, i believe they need to be seperated by a comma

adoRecordSet = adoConnection.Execute("GetSUBQList " + Session('SIDSS') + "," + Session("subject"));