|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
sql help in asn asp page..
i have put this code in the asp page...this is not the entire code for the asp page but a part of the code showing the sql query..the thing is the page does not show at all...it shows a internet explorer error page 'the page cannot be displayed'...
can u suggest what is wrong with this sql query...i am not exacrtly sure about the joining of multiple tables... here goes the sql query from my asp page... <code> <% set myConnection = server.createobject("ADODB.connection") myConnection.open "Hotels", "IWSDstudent", "assign2" mySQL1 = "select Bookings.BookingNum,Title,Fname,Lname,HouseNum," mySQL1 = mySQL1 & "Street,Suburb,State,Postcode,Phone," mySQL1 = mySQL1 & "RmType,RoomBooking.RoomNum,ServiceType from Customer,Bookings,RoomBooking,RoomRates,SuppBooking," mySQL1 = mySQL1 & "Services where Customer.CustomerID=Bookings.CustomerID and " mySQL1 = mySQL1 & "Bookings.BookingNum=RoomBooking.BookingNum and RoomBooking.RmTypeCode=RoomRates.RmTypeCode " mySQL1 = mySQL1 & "and Bookings.BookingNum=SuppBooking.BookingNum and SuppBooking.SuppServiceID=Services.SuppServiceID " mySQL1 = mySQL1 & " and SuppBooking.RoomNum= RoomBooking.RoomNum " mySQL1 = mySQL1 & "and Bookings.BookingNum= '2003000011'" set myRS1 = myConnection.execute(mySQL1) %> </code> please not that the title,Fname,Lname exists in only one table called the customer so i did not mention the tabvle name before their field name... please tell me what is wrong?? |
|
#2
|
|||
|
|||
|
hallo,
why do you think the problem ist the sql.query ? i sugest to put response.Write "here we are" response.flush response.end at the beginnigt of your script. perheps you get any error message which help you to identify the problem. when not put the output on differen placec in your script. with response.flush you can force the iis to send the proceded part of the page to the browser. out the sql string to the client and try to execute in in your sql-worksheet. by the way. the kind of bilding long sting like you done: strSql = "select field1, field2" strSql = strSql & "from blabla" ist hard to read and verrrrry inperformant try this way strSql = "SELECT a.field1, b.field2" & _ " FROM bla a, blabla b" & _ " WHERE a.key = b.key" i hope it helps janusz |
|
#3
|
|||
|
|||
|
another thing you could do, is build up your sql query (if you are sure it is this causing the error) and then type:
response.write(mySQL1) response.end |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > sql help in asn asp page.. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|