ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 28th, 2003, 08:21 PM
sfaiz2001 sfaiz2001 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: sydney, australia
Posts: 20 sfaiz2001 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to sfaiz2001
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??

Reply With Quote
  #2  
Old October 29th, 2003, 11:15 AM
janusz janusz is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 3 janusz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #3  
Old October 29th, 2003, 02:19 PM
Pain Pain is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: Sheffield, UK
Posts: 94 Pain User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to Pain
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > sql help in asn asp page..


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT