Syntax error in FROM clause

Results 1 to 3 of 3

Thread: Syntax error in FROM clause

  1. #1
    Join Date
    Dec 1969

    Default Syntax error in FROM clause

    I&#039m getting the following error:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80040e14&#039 <BR>[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause. <BR>/sc_additem.asp, line 20 <BR><BR>here is the code where line 20 is:<BR><BR>this is the function area that contains the code:<BR><BR>function prod_exists(byVal prod_id, byVal qty, byRef oconn)<BR>sqltext = "Select prod_id, qty from mm_shopcart WHERE cust_id = " & session.SessionID & " AND prod_id = " & prod_id & ""<BR>rs.Open sqltext, oconn, 3, 3, &H0002 &#039 (line 20)<BR><BR>the values sent to this function for this example are:<BR>prod_id = 12663<BR>qty = 1<BR>session.sessionID = 998546512<BR><BR>I don&#039t see anything wrong with the syntax, can anyone see something? Thanks in advance for any help.<BR><BR>Sam

  2. #2
    Join Date
    Dec 1969

    Default RE: Syntax error in FROM clause

    Try using your sql statement in access or sql server, remove the where criteria, work it in the database then replace the where criteria as needed.

  3. #3
    Michael Dean Guest

    Default RE: Syntax error in FROM clause

    Hi,<BR>It looks like you&#039re missing the single quotes around the session.sessionid value. Remember, session variables are all variants - even if you type in a number, ASP treats it like a string.<BR><BR>Try:<BR>.... cust_id = &#039" & session.SessionID & "&#039 AND ....<BR><BR>That&#039s a single quote, followed by a double quote, a space and then the ampersand; then on the other side of sessionId, it&#039s an ampersand, a space, a double quote, then the single quote.<BR><BR>

Posting Permissions

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