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

Help me find the problem 'cause I don't see it 2

Status
Not open for further replies.

JrClown

Technical User
Oct 18, 2000
393
US
Here's what I'm trying to do fellas,
Working with Access & ASP.
I have a table and a query.
On my query I have a field named logs that is the same number as in the table1 ID field.
What I'm trying to do is display on the screen, the name of the person where the ID is the same in both the Query and Table1. Here's what I'm doing, please advise me on what I'm doing wrong.
*********************** sample code ******************
<%
reqname = Request.form(&quot;Name&quot;)

SQL2 = &quot;select * from table1 where username = &quot; & reqname
Dim myRS1
set myRS1=server.createobject(&quot;ADODB.recordset&quot;)
myRS1.open SQL2, &quot;DSN=db1&quot;


sql = &quot;Select * from query1&quot;
sql = sql & &quot; where logged_id = '&quot; & reqdtname & &quot;' order by logintime&quot;
'sql = sql & &quot; where logged_id = '&quot; & Dtname3(&quot;id&quot;) & &quot;' order by logintime&quot;
Dim myRS2
set myRS2=server.createobject(&quot;ADODB.recordset&quot;)
myRS2.open sql, &quot;DSN=matte&quot;

if myRS2.EOF then
response.redirect &quot;norecordsfound.asp&quot;
end if
%>

I keep getting this error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

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

/site/search.asp, line 7

*********************** sample code ******************

&quot;The reward of one duty done is the power to fulfill another&quot;
<%
Jr Clown
%>
 
JrClown,

I presume that username is a text field. In which case you need to modify your SQL query to the following:

SQL2 = &quot;select * from table1 where username = '&quot; & reqname & &quot;'&quot;

Hope that helps.
Mise Le Meas,

Mighty :)
 
hi Jr

try
SQL2 = &quot;select * from table1 where username = &quot; & &quot;'&quot; & reqname & &quot;'&quot;

i think wha is missing is the quotes around the reqname field...

bastien
 
Thanks fellas, I was just not seeing it. &quot;The reward of one duty done is the power to fulfill another&quot;
<%
Jr Clown
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top