retrieve data from 2nd table in db

admin

Administrator
Staff member
Please can SOMEBODY help....... I have two tables in a database and an ASP file to connect and retrieve info based on a search. Now I have done this when there is one table in the database but its not working when there are two.


ASP code:

Set Conn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Recordset")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & server.mappath(".") & "\testcontacts.mdb"

set defined = server.createobject("adodb.recordset")
defined.open "select top " & DFatID * 10 & " keyword, destination, description from [contacts] where " & SQL & " order by keyword",Conn

This is the error I get:
error Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.

Any ideas? :(Hard to say without seeing the value in SQL

Good practice -
If you are using ASP and run into an error opening up a recordset, type the following in just before your open/execute statement


response.write(strQuery)
response.end

.....where strQuery is your SQL Statement.

When you call the page again, it will print out the SQL Statement and then stop all further processing.

From there you can either analyze the problem and hopefully find the cause or paste the actually statement out here and we can better help you fix the problem (hopefully ;))Thanks Putts. I created a relational database and am reworking the code more efficiently :rolleyes:Originally posted by sash
Thanks Putts. I created a relational database and am reworking the code more efficiently :rolleyes:

that-a-boy

relate the snot out of it.

That's my policy.
 
Back
Top