Too few parameters. Expected 1.

I

isaac2004

hi am getting this error about a wrong field name in my database and it
all seems right to me

<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include file="DatabaseConnect.asp"-->
<!--#include virtual="06winter/levini/database/adovbs.inc"-->
<html>
<head><title>Product Page</title></head>
<table

<!-- Header SSI starts here-->
<!--#include file="header.html"-->
<!-- Header SSI ends here-->
<!-- Menu SSI starts here-->
<!--#include file="menu.asp"-->
<!-- Menu SSI ends here-->
<!-- Author SSI begins here-->
<!--#include file="ListAuthors.asp"-->
<!-- Author SSI ends here-->


<% Dim strSQL, objRS, intBookID, strItemType




'sql statement for individual books
strSQL = "SELECT tblBookDescription.ISBN,
tblBookDescription.strTitle, tblBookDescription.strDescription,
tblBookDescription.strPublisher, tblBookDescription.decPrice " & _
"FROM tblBookDescription; "

response.write("strSQL = " & strSQL)


Set objRS = Server.CreateObject("ADODB.Recordset")


---------------------------------------------------Too few parameters.
Expected 1.
objRS.open strSQL, objConn
-----------------------------------------------------------------
'response.write("strSQL = " & strSQL)


objRS.close
Set objRS = nothing
objConn.close
Set objRS = nothing

%>
<!--#include file="footer.html"-->
<!--Menu SSI ends here-->


</body></html>


that is all of the page that loads up, i got the SQL statement from
Access which is right and the syntax looks right, can somebody help me
please. thank you
 
P

Paxton

isaac2004 said:
hi am getting this error about a wrong field name in my database and it
all seems right to me

<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include file="DatabaseConnect.asp"-->
<!--#include virtual="06winter/levini/database/adovbs.inc"-->
<html>
<head><title>Product Page</title></head>
<table

<!-- Header SSI starts here-->
<!--#include file="header.html"-->
<!-- Header SSI ends here-->
<!-- Menu SSI starts here-->
<!--#include file="menu.asp"-->
<!-- Menu SSI ends here-->
<!-- Author SSI begins here-->
<!--#include file="ListAuthors.asp"-->
<!-- Author SSI ends here-->


<% Dim strSQL, objRS, intBookID, strItemType




'sql statement for individual books
strSQL = "SELECT tblBookDescription.ISBN,
tblBookDescription.strTitle, tblBookDescription.strDescription,
tblBookDescription.strPublisher, tblBookDescription.decPrice " & _
"FROM tblBookDescription; "

response.write("strSQL = " & strSQL)


Set objRS = Server.CreateObject("ADODB.Recordset")


---------------------------------------------------Too few parameters.
Expected 1.
objRS.open strSQL, objConn
-----------------------------------------------------------------
'response.write("strSQL = " & strSQL)


objRS.close
Set objRS = nothing
objConn.close
Set objRS = nothing

%>
<!--#include file="footer.html"-->
<!--Menu SSI ends here-->


</body></html>


that is all of the page that loads up, i got the SQL statement from
Access which is right and the syntax looks right, can somebody help me
please. thank you

Copy whatever strSQL produces in your browser, then go to the Queries
tab in Access, switch to SQL view and paste, then run the query. If you
get a dialogue box prompting for input, you need to check the column
names in your code against the database. You have probably mispelled
one or more of them.

/P.
 
P

Paxton

isaac2004 said:
hi am getting this error about a wrong field name in my database and it
all seems right to me

<%@ Language=VBScript %>
<% Option Explicit %>
<!--#include file="DatabaseConnect.asp"-->
<!--#include virtual="06winter/levini/database/adovbs.inc"-->
<html>
<head><title>Product Page</title></head>
<table

<!-- Header SSI starts here-->
<!--#include file="header.html"-->
<!-- Header SSI ends here-->
<!-- Menu SSI starts here-->
<!--#include file="menu.asp"-->
<!-- Menu SSI ends here-->
<!-- Author SSI begins here-->
<!--#include file="ListAuthors.asp"-->
<!-- Author SSI ends here-->


<% Dim strSQL, objRS, intBookID, strItemType




'sql statement for individual books
strSQL = "SELECT tblBookDescription.ISBN,
tblBookDescription.strTitle, tblBookDescription.strDescription,
tblBookDescription.strPublisher, tblBookDescription.decPrice " & _
"FROM tblBookDescription; "

response.write("strSQL = " & strSQL)


Set objRS = Server.CreateObject("ADODB.Recordset")


---------------------------------------------------Too few parameters.
Expected 1.
objRS.open strSQL, objConn
-----------------------------------------------------------------
'response.write("strSQL = " & strSQL)


objRS.close
Set objRS = nothing
objConn.close
Set objRS = nothing

%>
<!--#include file="footer.html"-->
<!--Menu SSI ends here-->


</body></html>


that is all of the page that loads up, i got the SQL statement from
Access which is right and the syntax looks right, can somebody help me
please. thank you

On unrelated matters, you will get more errors when you've fixed the
field name one:

You've declared option explicit, and then dimmed two variables that
don't seem to be used in this code - intBookID, strItemType

and you've set the recordset to nothing twice. The second will
produce an object required error.

/P.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top