navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

My hairloss vs Too Few Parameters

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> My hairloss vs Too Few Parameters
Page: [1]
 
yogaboy

 

Posts: 377
Joined: 5/22/2004
Status: offline

 
My hairloss vs Too Few Parameters - 12/5/2004 18:35:54   
I get the following error far too much for my sanity

[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.


when I run use this sql statement
mySQL = "SELECT Org.OrgName, Org.Website, Org.OrgCode, Partnerships.cpName FROM Org, Partnerships " & _
"WHERE Partnerships.cpCode='" & CPSelected & "' AND Org.cpCode=Partnerships.cpCode2 ORDER BY Org.OrgName"


but, if I use this sql statement it works (spot the difference!!!)
mySQL = "SELECT Org.OrgName, Org.Website, Org.OrgCode, Partnerships.cpName FROM Org, Partnerships " & _
"WHERE Partnerships.cpCode='" & CPSelected & "' AND Org.cpCode=Partnerships.cpCode ORDER BY Org.OrgName"


If you can't see the difference, I don't blame you - the first statement has
AND Org.cpCode=Partnerships.cpCode2
the second statement has
AND Org.cpCode=Partnerships.cpCode

The 2 columns in the database are exactly the same, I even copied the first one into the second one. Does anyone have any ideas why this is happening, as I'm pulling out so much hair I'll be bald by tomorrow afternoon!:)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: My hairloss vs Too Few Parameters - 12/5/2004 20:06:55   
Look at using an OLEDB connection as ODBC has been depreciated

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to yogaboy)
yogaboy

 

Posts: 377
Joined: 5/22/2004
Status: offline

 
RE: My hairloss vs Too Few Parameters - 12/6/2004 5:33:20   
I had a look at the 4GuysFromRolla article about switching over to OLEDB, but I have a quick question - I'm using an include for the connection strings, won't displaying the full path to the database be a security liablity? Should I stop using the include so it's not available to anyone?? I haven't had any success using VIRTUAL so I have to keep the include file in the same directory as the asp files.

I'm not sure if I should worry about this...?

(in reply to yogaboy)
yogaboy

 

Posts: 377
Joined: 5/22/2004
Status: offline

 
RE: My hairloss vs Too Few Parameters - 12/6/2004 11:05:37   
Ok, I've changed everything on the site to OLEDB and very nice it is too!:)

But the problem still remained, until I realized I should have written

Org.cpCode2=Partnerships.cpCode
NOT
Org.cpCode=Partnerships.cpCode2

Sorry bout that Spooky, but muchos gracias for the help anyway, my db connection is now much better thanks to my bungling and your help!! :)

(in reply to yogaboy)
Spooky

 

Posts: 26599
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: My hairloss vs Too Few Parameters - 12/6/2004 13:41:16   
Try and name fields without special characters and numbers at the start / end of fields.

As long as the include is an asp file, there shouldnt be any security concerns.
DONT name it .inc or .txt or anything silly like that .... :)

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to yogaboy)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> My hairloss vs Too Few Parameters
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts