Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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 March 14th, 2005, 08:43 AM
Registered User
 
Join Date: Mar 2005
Location: Hyderabad, Andhra Pradesh, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to sadik
Default DataBase Error in ASP

i'm trying to retrieve values from the MS-access database into a asp field using sql query.

i'm giving the query as

strSQL ="SELECT add.* FROM add where add.prjname=pname;"

here the pname is the variable which store the value of the record to be retrieved in the database column named prjname.

i'm getting an error as

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10)
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
/TestASP/FIT_ver03_030105/html/myplane_new.asp, line 29

here line 29 is: rsAddComments.Open strSQL, adoCon


Can Anybody solve and help.
 
Old March 14th, 2005, 08:50 AM
Authorized User
 
Join Date: Jun 2003
Location: Witham, Essex, United Kingdom.
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You need to make sure that there is a valid value in pname, and that it is enclosed in single quotes e.g. 'Smith'

Unless you are joining tables, you do not need to specify the table name, so your SQL statement could read:

strSQL ="SELECT * FROM add where prjname='" & pname & "';"

It is probably also worth checking whether "add" is acceptable as a table name - it might be a reserved word.

Pat

-------------------
System 3 2000 Limited
www.system3-2000.co.uk




Similar Threads
Thread Thread Starter Forum Replies Last Post
Using "." while querying database..asp gives error Shuchik Classic ASP Basics 2 September 17th, 2007 02:47 AM
error with insertV.asp to database holyblast Classic ASP Databases 2 June 4th, 2007 09:28 AM
ASP or Database error naveedmustafa Classic ASP Databases 3 December 31st, 2004 01:28 PM





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