Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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 August 9th, 2004, 08:24 AM
Registered User
 
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Where am I going wrong ?

Hello,

Simple code :

Code:
Set cmd1 = Server.CreateObject("ADODB.Command")
Set prm1 = cmd1.CreateParameter("[Lowest]", adInteger, adParamInput)
prm1.Value = 2
cmd1.Parameters.Append prm1
cmd1.ActiveConnection = statistiques_connexion_STRING
cmd1.CommandText = "Parameters [Lowest] Long;" & _
"SELECT * FROM Client WHERE Client.CLCLEUNIK=[Lowest]"
cmd1.CommandType = adCmdText
cmd1.Execute
I get "Error '80040e10' Too Few Parameters. Expected 1"

I can't workout what I'm doing wrong ...
Thanks for your time.

 
Old August 9th, 2004, 10:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

What is the database you are using?

What is Parameters here, is that a stored procedure? If so, why do you append a select statement to it, for COMMANDobj.Text property?

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection
 
Old August 10th, 2004, 03:41 AM
Registered User
 
Join Date: Aug 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

I'm using an Access database.

This is not a stored procedure, the command text is an sql query and the command type is adCmdText.

Once I can make this simple code work the plan is to pass (from asp to access) some sql that will query a stored procedure instead of a table, hence the need to append parameters.

Thanks



 
Old August 10th, 2004, 04:56 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Then you might want to take a look at this link.

Parameterized Queries in Access

Hope that helps.
Cheers!

_________________________
- Vijay G
Strive for Perfection





Similar Threads
Thread Thread Starter Forum Replies Last Post
What's wrong ??? FT BOOK: ASP.NET Website Programming Problem-Design-Solution 2 November 3rd, 2005 09:18 AM
Help..What am I doing wrong... Brettvan1 VB.NET 2002/2003 Basics 2 October 18th, 2004 02:36 AM
Where did I go wrong??? ahc2inc VB.NET 2002/2003 Basics 3 September 28th, 2004 08:19 PM
What's wrong?Help! amu BOOK: Beginning ASP.NET 1.0 1 October 28th, 2003 08:21 PM





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