Click to See Complete Forum and Search --> : ODBC -internet


diana
08-08-2003, 03:43 PM
HY
Who can help me with a script ODBC ,,,?
I have a file asp and a database en access...when it is on my computer I can do it,,,DSN,,,,
but know I have a service internet ASP and the Mr. said to me
you must write a script for the link?
how can I do IT?

THKS
DIANA

diana
08-09-2003, 08:14 PM
Originally posted by Dave Clark
Basically, they're talking about a DSN-less connection. The following is an example of one:

myConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=URL=/folder/database.mdb;"

Also, this:

myConn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("/folder/database.mdb") & ";"

Dave

it doesn't work!!!
or I don't know how can I put the corecctly path?

<%option explicit%>
<%response.buffer=true%>

<%

Dim nLang ' Langue utilisée
Dim nDate ' Date du calendrier
Dim nURL ' URL de la page
Dim nDatePrev ' Mois précédent
Dim nDateSuiv ' Mois suivant
Dim nJour ' Jour du calendrier
Dim nMois ' Mois du calendrier
Dim nAnnee ' Année du calendrier
Dim nDate1 ' Date du premier jour du mois
Dim nJour2 ' Dernier jour du mois
Dim nDate2 ' Date du dernier jour du mois
Dim nDateDebut ' Première journée de la semaine
Dim nDateFin ' Dernière journée de la semaine
Dim nbrCase ' Nombre de case total du calendrier
Dim nNomJour ' Jour de la semaine pour boucle
Dim n ' Compteur pour boucle
' '''''''''''''''''''''''''''''''''''''''''''
' en = english


' '''''''''''''''''''''''''''''''''''''''''''
nLang = "en"

' '''''''''''''''''''''''''''''''''''''''''''
' Récupération de la date du la requète http
' Utilisation de la date courrante si aucune.
' '''''''''''''''''''''''''''''''''''''''''''
if request("date") = "" then
nDate = Date()
else
nDate = cDate(request.querystring("date"))
end if

' '''''''''''''''''''''''''''''''''''''''''''
' Configuration des variables
' '''''''''''''''''''''''''''''''''''''''''''
nURL = Request.ServerVariables("URL")
nDatePrev = DateAdd("m", -1, nDate)
nDateSuiv = DateAdd("m", 1, nDate)
nJour = Day(nDate)
nMois = Month(nDate)
nAnnee = Year(nDate)
nDate1 = DateSerial(nAnnee, nMois, 1)
Dim nTemp

nTemp = DateAdd("m", 1, nDate1)
nJour2 = Day(DateAdd("d", -1, nTemp))
nDate2 = DateSerial(nAnnee, nMois, nJour2)
nDateDebut = WeekDay(nDate1, vbSunday)
nDateFin = WeekDay(nDate2, vbSunday)
nbrCase = Day(nDate2) + (nDateDebut-1) + (7-nDateFin)
nNomJour = 1
%>

<html>
<head>
<title>Calendrier</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<<!-- *********** -->
<!-- * Fin CSS * -->




<!-- affichage -->



is is missing here a code!!!


<%dim objConn,objrec,qrysql,i,objconnstring



set objConn=server.Createobject("ADODB.Connection")
objConn.ConnectionTimeOut=60

objConn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0; Data Source=" & _
Server.MapPath("D:/Inetpub/wwwroot/alizesite/calendar/calendrier-v02.mdb") & ";"






qrysql="SELECT Tartist.nom_artist, Tstyle.nomstyle,Tcalendrier.titre , Tcalendrier.heure_debut ,Tcalendrier.prix_a_avance ,Tcalendrier.prix_a_la_porte ,Tcalendrier.datespec " & _
"FROM Tcalendrier ,Tartist, Tstyle " & _
"WHERE Tartist.idartist=Tcalendrier.refartist " & _
"AND Tstyle.idstyle=Tartist.refstyle " & _
"And Tcalendrier.datespec like '%" & nDate & "%';"





set objrec=objConn.execute(qrysql)
response.write("<br>")

response.write("<Table border=0 marginheight=7>" )


if objrec.eof then
response.write("<font color=white>")
response.write ("disponible")
end if

do while not objrec.eof

response.write("<tr>")
response.write("<td >" )
response.write("<font color=white>")
response.write UCASE(objrec ("nom_artist"))
response.write("</font>")
response.write("</td>")

response.write("<td>")
response.write("<font color=white>")
response.write Lcase(objrec("nomstyle"))
response.write("</font>")
response.write("</td>")

response.write("<td>")
response.write("<font color=white>")
if (objrec("titre"))=" " Then
response.write ("-")
else
response.write(objrec("titre"))
end if
response.write("</font>")
response.write("</td>")


response.write("<td>")
response.write("<font color=white>")
response.write(objrec("heure_debut"))
response.write("</font>")
response.write("</td>")


response.write("<td>")
response.write("<font color=white>")
response.write("avance :")
response.write(objrec("prix_a_avance"))
response.write("</font>")
response.write("</td>")

response.write("<td>")
response.write("<font color=white>")
response.write("porte :")
response.write(objrec("prix_a_la_porte")& "$")
response.write("</font>")
response.write("</td>")


response.write("</tr>")

objrec.movenext
loop

response.write("</Table>")
objConn.close
set objConn=nothing

%>


</td>
<td colspan=4> <img src="../images/calendrier.jpg" width="255" height="221"></td>
</tr>
<tr>
<td> <a href="../pages/accueil.html"
onMouseOver="MM_swapImage('Fond_12','','../images/Fond_12-over.jpg',1)"
onMouseOut="MM_swapImgRestore()"> <img name="Fond_12" src="../images/Fond_12.jpg" width=80 height=36 border=0 alt=""></a></td>
<td> <a href="calendrier.asp"
onMouseOver="MM_swapImage('Fond_13','','../images/Fond_13-over.jpg',1)"
onMouseOut="MM_swapImgRestore()"> <img name="Fond_13" src="../images/Fond_13.jpg" width=64 height=36 border=0 alt=""></a></td>
<td> <a href="../pages/evenements.html"
onMouseOver="MM_swapImage('Fond_14','','../images/Fond_14-over.jpg',1)"
onMouseOut="MM_swapImgRestore()"> <img name="Fond_14" src="../images/Fond_14.jpg" width=63 height=36 border=0 alt=""></a></td>
<td> <a href="../pages/devis.html"
onMouseOver="MM_swapImage('Fond_15','','../images/Fond_15-over.jpg',1)"
onMouseOut="MM_swapImgRestore()"> <img name="Fond_15" src="../images/Fond_15.jpg" width=51 height=36 border=0 alt=""></a></td>
<td> <a href="../pages/multimedia.html"
onMouseOver="MM_swapImage('Fond_16','','../images/Fond_16-over.jpg',1)"
onMouseOut="MM_swapImgRestore()"> <img name="Fond_16" src="../images/Fond_16.jpg" width=62 height=36 border=0 alt=""></a></td>
<td> <a href="../pages/partenaires.html"
onMouseOver="MM_swapImage('Fond_17','','../images/Fond_17-over.jpg',1)"
onMouseOut="MM_swapImgRestore()"> <img name="Fond_17" src="../images/Fond_17.jpg" width=65 height=36 border=0 alt=""></a></td>
<td> <a href="../pages/contact.html"
onMouseOver="MM_swapImage('Fond_18','','../images/Fond_18-over.jpg',1)"
onMouseOut="MM_swapImgRestore()"> <img name="Fond_18" src="../images/Fond_18.jpg" width=62 height=36 border=0 alt=""></a></td>
<td colspan=2> <img src="../images/Fond_19.jpg" width=102 height=36 alt=""></td>
<td> <img src="../images/Fond_20.jpg" width=91 height=36 alt=""></td>
</tr>
<tr>
<td> <img src="../images/Fond_21.jpg" width=80 height=75 alt=""></td>
<td> <img src="../images/Fond_22.jpg" width=64 height=75 alt=""></td>
<td> <img src="../images/Fond_23.jpg" width=63 height=75 alt=""></td>
<td> <img src="../images/Fond_24.jpg" width=51 height=75 alt=""></td>
<td> <img src="../images/Fond_25.jpg" width=62 height=75 alt=""></td>
<td> <img src="../images/Fond_26.jpg" width=65 height=75 alt=""></td>
<td> <img src="../images/Fond_27.jpg" width=62 height=75 alt=""></td>
<td colspan=2> <img src="../images/Fond_28.jpg" width=102 height=75 alt=""></td>
<td> <img src="../images/Fond_29.jpg" width=91 height=75 alt=""></td>
</tr>
<tr>
<td> <img src="../images/spacer.gif" width=80 height=1 alt=""></td>
<td> <img src="../images/spacer.gif" width=64 height=1 alt=""></td>
<td> <img src="../images/spacer.gif" width=63 height=1 alt=""></td>
<td> <img src="../images/spacer.gif" width=51 height=1 alt=""></td>
<td> <img src="../images/spacer.gif" width=62 height=1 alt=""></td>
<td> <img src="../images/spacer.gif" width=65 height=1 alt=""></td>
<td> <img src="../images/spacer.gif" width=62 height=1 alt=""></td>
<td> <img src="../images/spacer.gif" width=15 height=1 alt=""></td>
<td> <img src="../images/spacer.gif" width=87 height=1 alt=""></td>
<td> <img src="../images/spacer.gif" width=91 height=1 alt=""></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>


the folder ,where are my database is calendar ....
you can see my error on internet

the link is:
http://www.espacealize.com/calendar/calendrier.asp

I write good the path?I think something are wrong...

diana

diana
08-10-2003, 08:36 AM
Originally posted by Dave Clark
Change this:

Server.MapPath("D:/Inetpub/wwwroot/alizesite/calendar/calendrier-v02.mdb")

to this:

Server.MapPath("/alizesite/calendar/calendrier-v02.mdb")

or this:

Server.MapPath("/calendar/calendrier-v02.mdb")

I'm not sure which, because I'm not sure what is your root or current folder.
Which folder is your ASP page in?

Dave

It's work very good!!!
THANK YOU VERY MUCH!!!

BYE
DIANA