Ask a Question related to ASP Database, Design and Development.
-
lc #1
SQLs
Hi,
I have two or more sql statements that depends on the
other on the same page. For example I have strSQL3 and
then strSQL4 will need the result from the dropdown of
strSQL3 to start its sql. I actually need this to work
on the same page with ASP.
strSQL3 = "SELECT DISTINCT tblEV3Location.Code FROM
tblEV3Location ORDER BY tblEV3Location.Code;"
<% set cars3=adoCon.execute(strSQL3) %>
<select name="Code">
<% 'Loop through the recordset to make each entry
in the list. %>
<% do while not cars3.eof %>
<Option value = "<%= cars3(0) %>"> <%=
cars3(0) %></Option>
<%cars3.movenext
loop%>
</select>
How would I do something like this where the Code is the
name of the drop-down?:
strSQL4 = "SELECT DISTINCT tblEV3Location.Division FROM
tblEV3Location WHERE tblEV3Location.Division='Code';"
Thanks.
lc Guest
-
Error Executing Database Query. [Macromedia][SQLS
I don't think it's hardware related. Too many people have reported this issue, and from what I've read NOT SOLID solution has been offered. This is... -
John #2
Re: SQLs
Is it your intention to develope something like
[url]www.tenerife-dolphins-whales.com/bookings.asp[/url] (see locations / hotels)?
In this case this is done by Javascript because ASP is serverside.
If you wish i can post the code of this page.
John Guest
-
John #3
Re: SQLs
This is the right link [url]www.tenerife-dolphins-whales.com/booking.asp[/url] (see
locations / hotels)?
John Guest
-
lc #4
Re: SQLs
Hi John,
Yeap that is what I was looking for.
Can you please post the code?
Thank you.
whales.com/booking.asp (see>-----Original Message-----
>This is the right link [url]www.tenerife-dolphins-[/url]>locations / hotels)?
>
>
>.
>lc Guest
-
Aaron [SQL Server MVP] #5
Re: SQLs
Does your browser not have a View -> Source menu item?
[url]http://www.tenerife-dolphins-whales.com/td.js[/url]
--
[url]http://www.aspfaq.com/[/url]
(Reverse address to reply.)
"lc" <lc@hotmail.com> wrote in message
news:699401c47593$1b3e0c30$a601280a@phx.gbl...> Hi John,
>
> Yeap that is what I was looking for.
> Can you please post the code?
>
> Thank you.
>> whales.com/booking.asp (see> >-----Original Message-----
> >This is the right link [url]www.tenerife-dolphins-[/url]> >locations / hotels)?
> >
> >
> >.
> >
Aaron [SQL Server MVP] Guest
-
John #6
Re: SQLs
Mr. Aaron,
The Javascript code is written dynamically (on base of what is in the db)
when then ASP runs and the code is not static in td.js
The copyright function is asked by the client because in other pages
copywright protected images are used. For 95% of the visitors 'View Source'
or 'disableing JS' is unknown.
Search for 'fillcombo(this)': this is the start of the script.
<html>
<head>
<meta name="robots" content="NoIndex,NoFollow">
<title>Tenerife Dolphins Whales</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Page-Enter" Content="blendtrans(duration=0.5)">
<link rel="stylesheet" type="text/css" href="css.css">
<script src="td.js"></script>
<bgsound src="images/dolphin.wav" loop="-1">
<%
Response.Buffer = true
on error resume next
Dim Connect_String
Dim MyConn, RS
Connect_String="Provider=Microsoft.Jet.OLEDB.4.0;D ata Source=" &
Server.MapPath ("here your mdb")
Set MyConn=Server.CreateObject("ADODB.Connection")
Set RS=Server.CreateObject("ADODB.recordset")
MyConn.Open Connect_String
RS.ActiveConnection=MyConn
dim txt(12)
dim language
lang = Request.QueryString("lang")
extraq="If you have extra questions regarding one of our boat trips, or you
wish to know more about our special rates for groups, just click the little
dolphin above and send your questions by email ?"
Select Case lang
Case "NL"
txt(0)="Aanvraag"
txt(1)="Familienaam"
txt(2)="Land"
txt(3)="Taal"
txt(4)="Telefoon"
txt(5)="E-mail"
txt(6)="Hotel"
txt(7)="Plaats"
txt(8)="Boot"
txt(9)="Datum"
txt(10)="Volwassenen"
txt(11)="Kinderen (3-11 jr)"
txt(12)="Extra vragen"
language = "NEDERLANDS"
Nxt = "** STAAT NIET IN LIJST **"
Nxt2 = "Adres van uw logies."
extraq="Misschien heeft u nog vragen over een van onze boottrips? Of wilt u
meer weten over onze speciale tarieven voor groepen? Klik dan op het
dolfijntje om uw vragen per e-mail te verzenden."
info1="In onze bevestiging wordt de plaats en het uur van afspraak met de
gratis bus medegedeeld."
Case "FR"
txt(0)="Demande"
txt(1)="Nom de famile"
txt(2)="Pays"
txt(3)="Language"
txt(4)="Téléphone"
txt(5)="E-mail"
txt(6)="Hotel"
txt(7)=""
txt(8)="Bateaux"
txt(9)="Date"
txt(10)="Adultes"
txt(11)="Enfants (3-11)"
txt(12)="Questions supplémentaires"
extraq="Vous avez peut-être encore des questions concernant une de nos
excursions en bateau? Ou voulez-vous savoir plus de nos tarifs spéciaux pour
groupes? Cliquez alors sur le petit dauphin pour envoyer vos questions par
mail."
language = "FRANÇAIS"
Nxt = "** PAS DANS LA LISTE **"
Nxt2 = "Adresse logis."
info1="Vous y trouverez e.a. l'heure exacte et le lieu du rendez-vous avec
le transfert gratuit dans notre confirmation."
Case "DE"
txt(0)="Antrag"
txt(1)="Familienname"
txt(2)="Land"
txt(3)="Sprache"
txt(4)="Telefon"
txt(5)="E-mail"
txt(6)="Hotel"
txt(7)=""
txt(8)="Boot"
txt(9)="Datum Rundfahrt"
txt(10)="Erwachsenen"
txt(11)="Kindern (3-11)"
txt(12)="Extra Fragen"
language = "DEUTSCH"
Nxt = "** NICHT IN LISTE **"
Nxt = "Adresse Logis"
extraq="Sie haben noch Fragen über eine unserer Bootsfahrten? Oder Sie
möchten mehr wissen über unsere Sondertarife für Gruppen? Klicken Sie auf
den Delfin um Ihre Fragen per Email zu versenden."
info1="In der Bestätigung erfahren Sie unter anderem die genaue Uhrzeit und
den Abfahrtsort für die kostenlose Busfahrt."
Case "ES"
txt(0)="Solicitud"
txt(1)="Apellido"
txt(2)="País"
txt(3)="Lengua"
txt(4)="Teléfono"
txt(5)="E-mail"
txt(6)="Hotel"
txt(7)=""
txt(8)="Barco"
txt(9)="Fecha excursión"
txt(10)="Adultas"
txt(11)="Niños (3-11)"
txt(12)="Más preguntas"
language = "ESPAÑOL"
Nxt = "** NOT IN LIST **"
Nxt2 = "Dirección alojamiento."
extraq="¿Tiene alguna pregunta acerca de nuestras excursiones en barco? ¿O
quiere más información sobre nuestras tarifas especiales para grupos? En ese
caso, haga clic sobre el delfín para enviarnos sus preguntas por e-mail."
info1="En nuestra confirmación le comunicaremos, entre otras cosas, la hora
exacta y el lugar de salida del autobús gratuito."
Case Else
txt(0)="Request"
txt(1)="Name"
txt(2)="Country"
txt(3)="Language"
txt(4)="Phone"
txt(5)="E-Mail"
txt(6)="Hotel"
txt(7)=""
txt(8)="Boat"
txt(9)="Date"
txt(10)="Adults"
txt(11)="Children (3-11 yr)"
txt(12)="Extra Questions"
language = "ENGLISH"
Nxt = "** NOT IN LIST **"
Nxt2 = "Address accommodations."
info1="You will be informed of the rendez vous place and hour with the free
bus in our confirmation mail."
End Select
%>
</head>
<body topmargin="0" leftmargin="0" bgcolor="#196097">
<map id="sitemap" name="mapp">
<area shape="rect" coords="0,0,175,100" alt="Home Royal Delfin" a
href="royal-delfin" target="_top">
<area shape="rect" coords="177,0,362,100" alt="Home Tropical Delfin" a
href="royal-delfin" target="_top">
<area shape="rect" coords="365,0,535,100" alt="Home Nostramo" a
href="nostramo" target="_top">
</map>
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse:
collapse" width="700" id="AutoNumber1" height="100">
<tr>
<td width="100%">
<img src="images\book_head.jpg" usemap="#sitemap" width="700" height="100"
border="0">
</td>
</tr>
</table>
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" width="700" bordercolor="#C0C0C0">
<td width="700" class="lang"> <a
href="booking.asp?lang=ES">ESPAÑOL</a> |
<a href="booking.asp?lang=UK" target="_top">ENGLISH</a> |
<a href="booking.asp?lang=DE" target="_top">DEUTSCH</a> |
<a href="booking.asp?lang=FR" target="_top">FRANCAIS</a> |
<a href="booking.asp?lang=NL" target="_top">NEDERLANDS</a> |
<a href="booking.asp?lang=NO" target="_top">NORSK</a></td>
</tr>
</table>
<center>
<table border="0" cellpadding="0" cellspacing="0" style="border:1px
solid #C0C0C0; border-collapse: collapse" width="700"
background="images/book_bg.jpg">
<tr>
<td width="500" align="left" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="490"
class="st">
<form name="f" method="POST" action="email.asp">
<tr>
<td width="140"><%=txt(0)%></td>
<td width="350"><input type="text" name="req" size="40" tabindex="0"
class="st" value="<%=date()&"-"&time()%>" readonly></td>
</tr>
<tr>
<td width="100"><%=txt(1)%></td>
<td width="390"><input type="text" name="name" size="40" tabindex="1"
class="st"></td>
</tr>
<tr>
<td width="100"><%=txt(2)%> </td>
<td width="390"><input type="text" name="country" size="40" tabindex="2"
class="st"></td>
</tr>
<tr>
<td width="100"><%=txt(3)%> </td>
<td width="390"><input type="text" name="language" size="40"
tabindex="3" class="st" value="<%=language%>"></td>
</tr>
<tr>
<td width="100"><%=txt(4)%> </td>
<td width="390"><input type="text" name="phone" size="40" tabindex="4"
class="st"></td>
</tr>
<tr>
<td width="100"><%=txt(5)%> </td>
<td width="390"><input type="text" name="email" size="40" tabindex="5"
class="st"></td>
</tr>
<tr>
<td width="100"><%=txt(6)%> </td>
<td width="390">
<%
RS.Open "SELECT * FROM tblHotels ORDER BY location, hotel"
Response.Write "<select class=""st"" size=""5"" name=""location""
ONCHANGE=""fillcombo(this);"">"
Response.Write "<option value=''>" & Nxt & "</option>"
JS="function fillcombo(elem){" & vbCrLf & _
"for (var i = document.f.hotel.options.length-1; i >= 0;
i--){document.f.hotel.options[i] = null;"
RS.Open "SELECT * FROM tblHotels ORDER BY hotel"
Do While Not RS.EOF
if sLastLocation <> RS("location") Then
sLastLocation = RS("location")
Response.Write "<option value=" & Chr(34) & RS("location") & Chr(34) &
">" & RS("location") & "</option>"
JS = JS & "}" & vbCrLf & _
"if (elem.options[elem.selectedIndex].value=='" & RS("location") & "'){"
End If
JS = JS & "document.f.hotel.options[document.f.hotel.options.length] = new
Option('" & RS("hotel") & "','" & RS("hotel") & "');"
RS.MoveNext
Loop
Response.Write "</select>"
Response.Write "<select name=""hotel"" size=""5"" class=""st"">"
Response.write "<option>"& Nxt &"</option>"
Response.Write "</select>"
JS=JS & vbCrLf & "}" & vbCrLf & "}"
Response.Write "<SCRIPT LANGUAGE=""Javascript"">"
Response.Write JS & vbCrLf & "</script>"
%>
</tr>
<tr>
<td width="100"><%=txt(7)%> </td>
<td width="390"><%=Nxt2%><br>
<input type="text" name="hotel2" size="40" tabindex="7" class="st"><br>
</td>
</tr>
<tr>
<td width="100"><%=txt(8)%> </td>
<td width="390">
<select size="1" name="article" class="st" tabindex="8">
<%Select Case lang%>
<%Case "ES"%>
<option value="1" SELECTED>NOSTRAMO (TENERIFE SUR - 4,5 horas)</option>
<option value="2">NOSTRAMO (TENERIFE NORTE- 4,5 horas)</option>
<option value="">-</option>
<option value="3">ROYAL DELFIN (TENERIFE SUR - 4,5 horas)</option>
<option value="4">ROYAL DELFIN (TENERIFE SUR - 3 horas)</option>
<option value="5">ROYAL DELFIN (TENERIFE NORTE - 4,5 horas)</option>
<option value="0">-</option>
<option value="6">TROPICAL DELFIN (TENERIFE SUR - 4,5 horas)</option>
<option value="7">TROPICAL DELFIN (TENERIFE SUR - 3 horas)</option>
<option value="8">TROPICAL DELFIN (TENERIFE NORTE - 4,5 horas)</option>
<%Case "NL"%>
<option value="1" SELECTED>NOSTRAMO (ZUID-TENERIFE - 4,5 uur
trip)</option>
<option value="2">NOSTRAMO (NOORD-TENERIFE - 4,5 uur trip)</option>
<option value="0">-</option>
<option value="3">ROYAL DELFIN (ZUID-TENERIFE - 4,5 uur trip)</option>
<option value="4">ROYAL DELFIN (ZUID-TENERIFE - 3 uur trip)</option>
<option value="5">ROYAL DELFIN (NOORD-TENERIFE - 4,5 uur trip)</option>
<option value="0">-</option>
<option value="6">TROPICAL DELFIN (ZUID-TENERIFE - 4,5 uur
trip)</option>
<option value="7">TROPICAL DELFIN (ZUID-TENERIFE - 3 uur trip)</option>
<option value="8">TROPICAL DELFIN (NOORD-TENERIFE - 4,5 uur
trip)</option>
<%Case "FR"%>
<option value="1" SELECTED>NOSTRAMO (TENERIFFE SUD - 4,5
heures)</option>
<option value="2">NOSTRAMO (TENERIFFE NORD - 4,5 heures)</option>
<option value="0">-</option>
<option value="3">ROYAL DELFIN (TENERIFFE SUD - 4,5 heures)</option>
<option value="4">ROYAL DELFIN (TENERIFFE SUD - 4,5 heures)</option>
<option value="5">ROYAL DELFIN (TENERIFFE NORD - 4,5 heures)</option>
<option value="0">-</option>
<option value="6">TROPICAL DELFIN (TENERIFFE SUD - 4,5 heures)</option>
<option value="7">TROPICAL DELFIN (TENERIFFE SUD - 4,5 heures)</option>
<option value="8">TROPICAL DELFIN (TENERIFFE NORD - 4,5
heures)</option>
<%Case "DE"%>
<option value="1" SELECTED>NOSTRAMO (TENERIFFA Süd - 4,5 St.)</option>
<option value="2">NOSTRAMO (TENERIFFA NORD - 4,5 St.)</option>
<option value="0">-</option>
<option value="3">ROYAL DELFIN (TENERIFFA Süd - 4,5 St.)</option>
<option value="4">ROYAL DELFIN (TENERIFFA Süd - 4,5 St.)</option>
<option value="5">ROYAL DELFIN (TENERIFFA NORD - 4,5 St.)</option>
<option value="0">-</option>
<option value="6">TROPICAL DELFIN (TENERIFFA Süd - 4,5 St.)</option>
<option value="7">TROPICAL DELFIN (TENERIFFA Süd - 4,5 St.)</option>
<option value="8">TROPICAL DELFIN (TENERIFFA NORD - 4,5 St.)</option>
<%Case Else%>
<option value="1" SELECTED>NOSTRAMO (TENERIFE SOUTH - 4,5
Hours)</option>
<option value="2">NOSTRAMO (TENERIFE NORTH - 4,5 Hours)</option>
<option value="0">-</option>
<option value="3">ROYAL DELFIN (TENERIFE SOUTH - 4,5 hours)</option>
<option value="4">ROYAL DELFIN (TENERIFE SOUTH - 3 hours)</option>
<option value="5">ROYAL DELFIN (TENERIFFE NORTH - 4,5 hours)</option>
<option value="0">-</option>
<option value="6">TROPICAL DELFIN (TENERIFE SOUTH - 4,5 hours)</option>
<option value="7">TROPICAL DELFIN (TENERIFE SOUTH - 3 hours)</option>
<option value="8">TROPICAL DELFIN (TENERIFFE NORTH - 4,5
hours)</option>
<%End Select%>
</select></td>
</tr>
<tr>
<td width="100"><%=txt(9)%> </td>
<td width="390">
<select size="1" name="day" class="st" tabindex="9">
<%For d = 1 to 31%>
<option value="<%=d%>"><%=d%></option>
<%Next%>
</select>
<select size="1" name="month" class="st" tabindex="10">
<%For d = 1 to 12%>
<option value="<%=d%>"><%=d%></option>
<%Next%>
</select>
<select size="1" name="year" class="st" tabindex="11">
<%For d = 2004 to 2010%>
<option value="<%=d%>"><%=d%></option>
<%Next%>
</select>
</td>
</tr>
<tr>
<td width="100"><%=txt(10)%></td>
<td width="390">
<select size="1" name="adults" class="st" tabindex="12">
<%For d = 1 to 80%>
<option value="<%=d%>"><%=d%></option>
<%Next%>
</select>
</td>
</tr>
<tr>
<td width="100"><%=txt(11)%></td>
<td width="390">
<select size="1" name="children" class="st" tabindex="13">
<%For d = 0 to 80%>
<option value="<%=d%>"><%=d%></option>
<%Next%>
</select>
</td>
</tr>
<tr>
<td width="100"><%=txt(12)%></td>
<td width="390"><textarea rows="5" name="extra" cols="40"
tabindex="14"></textarea>
</tr>
<tr>
<td width="100"> </td>
<td width="390"><%=info1%></textarea>
</tr>
<tr>
<td width="100"> </td>
<td width="390"> <input type="submit" name="send" class="st" tabindex="15"
<%Select Case lang%>
<%Case "NL"%>
value="Verzenden"
<%Case "FR"%>
value="Envoyé"
<%Case "ES"%>
value="Enviar"
<%Case "DE"%>
value="Versenden"
<%Case ELSE%>
value="Send"
<%End Select%>>
<input type="reset" name="reset" class="st" tabindex="16"
<%Select Case lang%>
<%Case "NL"%>
value="Wissen"
<%Case ELSE%>
value="Reset"
<%End Select%>>
</td>
</tr>
</form>
</table>
</td>
<td width="200" class="st" align="center" valign="top">
<table width="100%" cellspacing="4">
<tr><td class="st" align="center">
<a
href="mailto:info@tenerifedolphin.com?bcc=pg@tener ifedolphin.com;info@teneri
fe-sport.com"><img src="images\email.gif" border="0"></a><br>
<%=extraq%>
</td></tr>
</table>
</td>
</tr>
</table>
</center>
</div>
</body>
</html>
John Guest



Reply With Quote

