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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

No Value given for one or more required parameters??? 1

Status
Not open for further replies.

jasek78

Programmer
Nov 5, 2001
298
US
I get this error message:

* Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/status/ConceptList.asp, line 94

Here is the code:

'Get key & command
If Request.QueryString("id").Count > 0 Then
id=Request.QueryString("id")
Session("id") = id
dbwhere = "[ProjectID]=" & id
Else
id = Session("id")
End If

' Open Connection to the database
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("/status/db/projects.mdb") & ";User ID=;Password=;"

' Build Query
strsql = "select * from [Concept]"

If dbwhere <> &quot;&quot; Then
strsql = strsql & &quot; WHERE &quot; & dbwhere
End If

if OrderBy <> &quot;&quot; then
strsql = strsql & &quot; ORDER BY [&quot; & OrderBy & &quot;] &quot; & Session(&quot;OrderType&quot;)
end if

'response.write strsql

set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rs.Open strsql, conn, 1, 2 '<-----line 94

 


strsql = &quot;select * from [Concept] WHERE [ProjectID] = id

where id is a variable passed to the page of the ProjectID of the concepts to be shown
 
can you uncomment this line:

'response.write strsql

and see what is actually being built for your sql statement, specifically, is a value for id actually being passed to it?
if after seeing your sql statement, if you still have questions, copy and paste what is actually being built for your sql statement, and displayed by response.write.
 
It just jumps to the generic error message. I've tried trapping it and showing my own error page, but it does not work.

' Display message when error found
If (Err.Number <> 0) Or (Err.Number = 0)Then
Response.write(&quot;SQL: &quot; & strsql & &quot;<br>&quot;)
Response.write(&quot;Error Code: &quot; & Err.Number & &quot;<br>&quot;)
Response.write(&quot;Error Description: &quot; & Err.Description & &quot;<br>&quot;)
Response.write(&quot;Error Source: &quot; & Err.Source & &quot;<br>&quot;)
Response.write(&quot;Error Line: &quot; & Err.Line & &quot;<br>&quot;)
response.end
End If
 
jasek78,

You can do the following:

response.write strsql
response.end


fengshui_1998
 
Thanks...

Here is the SQL string -

[bold]
select * from [Concept] WHERE [ProjectID]=MMS0061
[/bold]

The connection object is correct (it is used successfully on other pages), and the Table Name and Field Name are spelled correctly. Is there supposed to be quotes around the MMS0061 (i.e: &quot;MMS0061&quot;)??

again, thanks for the help.

jason
 
since your id is alphanumeric, it needs to be surrounded by single quotes as such:

dbwhere = &quot;[ProjectID]='&quot; & id & &quot;' &quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top