Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL relaited question

Status
Not open for further replies.

BarryMVS

IS-IT--Management
Apr 17, 2003
172
GB
Hi all,

I keep getting the following error:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.


This is the posted data:
Code:
POST Data:
check=4&jobtypeID=2&englist=Brian+Buist&cuSer1=Vir&cuSer2=Glas&date=16+Jul+2004&allday=True

And this is the transfer from the posted data to ASP variables:
Code:
cuSer1 = request.Form("cuSer1")
cuSer2 = request.Form("cuSer2")

This is the SQL statement that is causing the error:
Code:
cusSql = "SELECT * FROM Customers WHERE [Company Name] <> ' ' AND [Company Nmae] LIKE '%" & cuSer1 & "%' AND [Company Name] NOT LIKE '(CLOSED)%' AND [Company Name] NOT LIKE '(DUPLICATED)%' AND [Address Line 3] LIKE '%" & cuSer2 & "%' ORDER BY [Company Name];"
set cus1 = conn.Execute(cusSql)

Any ideas are most welcomed.

Thanks,

Barry

ICT Network Administrator
IT Services Manager
 
cusSql = "SELECT * FROM Customers WHERE [Company Name] <> ' ' AND [Company Nmae] LIKE '%" & cuSer1 & "%' AND [Company Name] NOT LIKE '(CLOSED)%' AND [Company Name] NOT LIKE '(DUPLICATED)%' AND [Address Line 3] LIKE '%" & cuSer2 & "%' ORDER BY [Company Name];"
set cus1 = conn.Execute(cusSql)

if this is a direct copy-paste you may want to address the spelling of Name highlighted above.
 
DO'H!

I think I've been working on this code for too long. My eyes are starting to blur!

Thanks for the assistance. I'm going to take a break.

Cheers,

Barry

ICT Network Administrator
IT Services Manager
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top