embeded query

Results 1 to 2 of 2

Thread: embeded query

  1. #1
    Join Date
    Dec 1969

    Default embeded query

    I&#039;m a novice asp programmer and have a quick question.<BR><BR>I have two tables.<BR><BR>Table Flights<BR>Field FlightID - is the primary key<BR>Field FlightTime<BR>.<BR>. - other fields<BR>.<BR><BR>Table Stops<BR>field FlightID<BR>Field Stop - The fields Stop and FlightID make a composite key so each FlightID has multiple records with different values for Stop<BR><BR><BR> <BR>&#060;% <BR>Dim rs <BR>Dim strSQL <BR>Dim adoCon <BR>Set adoCon = Server.CreateObject("ADODB.Connection") <BR>adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("logbook.mdb") <BR>Set rs = Server.CreateObject("ADODB.Recordset") <BR> <BR>strSQL = "SELECT * FROM Flights;" <BR>rs.Open strSQL, adoCon<BR>Do While not rs.EOF <BR><BR>response.write(rs("FlightID"))<BR><BR><B R> **** HERE is my question *******<BR> I want all related stops or essentially something like this<BR><BR> StopSQL = "SELECT * FROM Stops where FlightID = rs("FlightID");" <BR> rs.Open StopSQL, adoCon<BR> Do While not rs.EOF <BR><BR> response.write(rs("Stop"))<BR><BR> rs.MoveNext<BR> Loop<BR> rs.Close<BR><BR> ************** Obviously the logic makes sense but I gues I can&#039;t embed a query like that. <BR> How do you do that??<BR> Thanks!<BR><BR><BR>rs.MoveNext<BR>Loop<BR>rs.Close %&#062;<BR>

  2. #2
    Join Date
    Dec 1969

    Default String concatenation.

    How do you concatenate 2 strings?<BR><BR>s1 = "Hello"<BR>s2 = "World"<BR><BR>How do you have get s3 to equal "Hello World" by using s1 and s2?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts