Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    May 2007
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Two parameter MSAccess query USING JAVASCRIPT

    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:

    Code:
    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:

    Code:
    .......
    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?

  • #2
    Regular Coder
    Join Date
    Mar 2007
    Posts
    505
    Thanks
    1
    Thanked 19 Times in 19 Posts
    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.
    To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
    Please, if you found my post helpful, pay it forward. Go and help someone else today.

  • #3
    Regular Coder
    Join Date
    Jan 2005
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if the 2 session values are your parameters, i believe they need to be seperated by a comma
    Code:
    adoRecordSet = adoConnection.Execute("GetSUBQList " + Session('SIDSS') + "," + Session("subject"));


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •