Hello all!
I`m trying to make a query which will bring me records from 3 different tables. The first table is named "customers", the second "drugs" and the third "surgery".
From the first table I`ll print out a single record but from the second and the third table I want to print out all the records that match with the "customers.name" and "customers.petname" fields with the "drugs.name", "drugs.petname" and "surgery.name". "surgery.petname".
When I print out the data from the first table everything is ok. Then I try to insert "customers.name" to a variable make a query for the second table. But there I get an error.
The error is :
Microsoft OLE DB Provider for ODBC Drivers (0x80040E10) Too few parameters. Expected 1.
Code:
dim customer
customer= rsGuestbook("name")
strSQL1 = "SELECT * FROM drugs WHERE name = " & customer & "
I tried the "response.write strSQL1" and I got back
Select * FROM drugs WHERE name = John Smith