Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 1st, 2006, 11:28 AM
Registered User
 
Join Date: Jun 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default website error

I have read several posts re this issue and still cannot figure out my problem. (Code works fine for almost all Agents except one.) Any help would be appreciated.


Receiving the following error (code below):

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'L'.
/acs.asp, line 175


SQL CODE:
function RetrieveBranch(dcnDB)
    dim strSQL
    dim rsBranch
    if request.form("RegionList") = "USA" then
        strSQL = "select distinct IATA, Agent, City, State, Zip from Agent where Agent in ('" & request.form("AgentList") & "') order by IATA "
    else
        strSQL = "select distinct IATA, Agent, City, State, Zip from Agent where Agent in ('" & request.form("AgentList") & "') and Region in ('" & request.form("RegionList") &"') order by IATA "
    end if
    set rsBranch = dcnDB.Execute(strSQL) (THIS IS LINE 175)
    set RetrieveBranch = rsBranch
end function

Thanks.

 
Old June 1st, 2006, 12:25 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Can you post the SQL statement that creates the error?

Before line 175 write:

Response.Write strSQL
Response.End

Then run this code selecting the Agent that produces the error. Then post that SQL statement here.

 
Old June 1st, 2006, 01:01 PM
Registered User
 
Join Date: Jun 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

After inserting
Response.Write strSQL
Response.End

Output below:

select distinct IATA, Agent, City, State, Zip from Agent where Agent in ('EXPEDITORS INT'L. OF WASHINGTON INC.') order by IATA


I have checked over the records for this Agent and all looks normal.

 
Old June 1st, 2006, 01:08 PM
Registered User
 
Join Date: Jun 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Problem solved.

It was the "'" in the name (int'l)that was causing the error.

Thanks :D

EXPEDITORS INT'L. OF WASHINGTON INC






Similar Threads
Thread Thread Starter Forum Replies Last Post
error when debging website WroxUnited pdf kingchemical ASP.NET 2.0 Basics 1 February 20th, 2008 01:28 PM
all about website benny HTML Code Clinic 2 February 11th, 2008 04:49 AM
Dynamic website to Static website Aboal3ood ASP.NET 1.x and 2.0 Application Design 4 December 7th, 2006 11:46 AM
Unknown Error "-1" when opening new website MzMoody BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 2 November 10th, 2006 01:08 PM
The Code of book ASP.NET Website Programming Error jackahu BOOK: ASP.NET Website Programming Problem-Design-Solution 0 June 16th, 2004 11:04 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.