Home > Archive > ASP > February 2006 > Characters found after end of SQL statement
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Characters found after end of SQL statement
|
|
| isaac2004 2006-02-20, 3:55 am |
| hello getting wierd error from SQL statement
it is
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Characters found after end of
SQL statement.
here is my server side code
<% Dim strSQL, objRS, strTitle, dblPrice, strISBN, strDescription,
curPrice, curDiscPrice
strISBN = request.querystring("ISBN")
'sql statement for individual books
strSQL = "SELECT tblBookDescription.ISBN,
tblBookDescription.strTitle, tblBookDescription.strDescription,
tblBookDescription.strPublisher, tblBookDescription.dblPrice,
tblAuthors.AuthorID " & _
"FROM tblAuthors INNER JOIN (tblBookDescription INNER JOIN
tblAuthorsBooks ON tblBookDescription.ISBN = tblAuthorsBooks.ISBN) ON
tblAuthors.AuthorID = tblAuthorsBooks.AuthorID; " & _
"WHERE (((tblBookDescription.ISBN)='" & strISBN & "')) "
response.write("strSQL = " & strSQL)
Set objRS = Server.CreateObject("ADODB.Recordset")
-----------------------------------------error here
objRS.open strSQL, objConn
-----------------------------------------------------------
'response.write("strSQL = " & strSQL)
curPrice = FormatCurrency(objRS("dblPrice"))
curDiscPrice = FormatCurrency((objRS("dblPrice")*.8))
dblPrice = (objRS("dblPrice"))
%>
any help please, i think it occurs where i concatenate the strISBN into
the SQL statement
| |
| Dave Anderson 2006-02-20, 3:55 am |
| isaac2004 wrote:
> strSQL = "SELECT tblBookDescription.ISBN,
> tblBookDescription.strTitle, tblBookDescription.strDescription,
> tblBookDescription.strPublisher, tblBookDescription.dblPrice,
> tblAuthors.AuthorID " & _
> "FROM tblAuthors INNER JOIN (tblBookDescription INNER JOIN
> tblAuthorsBooks ON tblBookDescription.ISBN = tblAuthorsBooks.ISBN) ON
> tblAuthors.AuthorID = tblAuthorsBooks.AuthorID; " & _
> "WHERE (((tblBookDescription.ISBN)='" & strISBN & "')) "
Lose the semicolon right before your WHERE clause.
--
Dave Anderson
Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
| |
| Bob Barrows [MVP] 2006-02-20, 6:55 pm |
| isaac2004 wrote:
>
> response.write("strSQL = " & strSQL)
>
>
This was well-spotted by Dave, but you could have made it easier for us by
showing us the result of this response.write.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
|
|
|
|
|