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

In my db I have three tables Breede 1

Status
Not open for further replies.

finnoscar

Technical User
Aug 17, 2002
55
0
0
GB
In my db I have three tables Breeder=(BrNo,BrName,BrPhoneNo,BrAddress,BreedName)
Customer=(CNo,CName,CAddress,CPhoneNo)
ProvBooking=(BrNo,CNo,BookingDate)
I want a Breeder to be able enter their BrNo to query the db to see the details of customers who have booked a pup with them,what form should my SQL statement take?
 
PARAMETERS BrNo Long;
SELECT tblCustomer.*
FROM tblCustomer INNER JOIN tblProvBooking ON tblCustomer.Cno = tblProvBooking.Cno
WHERE (((tblCustomer.Cno)=[tblprovbookung].[cno]) AND ((tblProvBooking.Brno)=[BrNo]));
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
This is my whole code has the SQL been added correctly

<% var str_BreederNo = new String(Request.Form(&quot;BreederNo&quot;));
if (str_BreederNo! = &quot;undefined&quot;){
%>
<%
// Open connection to database, then populate a recordset with list of Breeders
var adoConnection = Server.CreateObject(&quot;ADODB.Connection&quot;);
var adoRecordSet;
var mySQL;
adoConnection.Open(&quot;DSN=DogDSN&quot;);
var mySQL =' PARAMETERS BreederNo Long;
SELECT tblCustomer.*
FROM tblCustomer INNER JOIN tblProvBooking ONtblCustomer.CNo = tblProvBooking.CNo
WHERE (((tblCustomer.CNo= [tblProvBooking].[CNo]
AND((tblProvBooking.BreederNo) = [&quot;' + str_BreederNo +'&quot;]';
adoRecordSet = adoConnection.Execute(mySQL);

// Loop through recordset and write stock details out to page
while ( adoRecordSet.Eof == false )
{
%>
Thanks for your help
 
Could someone please tell me if this is the correct way to go about allowing a user to enter their BreederNo and getting a list of bookings for themselves from the two tables
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top