sql error

Results 1 to 2 of 2

Thread: sql error

  1. #1
    klovis Guest

    Default sql error

    The following sql statement:<BR>sql= " SELECT Category_Title FROM Category WHERE Category_Id = " & Category_Id<BR><BR>results in this error:<BR><BR>Syntax error (missing operator) in query expression &#039Category_Id =&#039. <BR><BR>What is wrong with the sql? Could it have anything to do with SQL server - Access (it is originally an SQL Server ASP script)<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: sql error

    A tip for everyone:<BR>***ALWAYS*** do:<BR><BR>Response.Write sql<BR><BR>immediately BEFORE your recordset open statement! This way, you can see the EXACT string that is being passed to SQL. I would be willing to wager that Category_ID, the variable in your ASP pages, is not initialized, and therefore is an empty string, so your SQL string looks like:<BR><BR>SELECT Category_Title FROM Category WHERE Category_Id =<BR><BR>Which, of course, is erroneous.

Posting Permissions

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