|
Bonjour,
Je viens de faire mon premier fichier .asp
Mais ça plante sur le message
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x400 Thread 0x93c DBC 0x5f3194c Jet'.
Voici mon code. je penses que ca vient du champ DSN_BASE. Le fichier .mdb est dans le répertoire db et ma page .asp dans un répertoire page.
root/page/essai.asp
root/db/base.mbd
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Store Directory</title>
</head>
<body topmargin="0" leftmargin="0">
'Create, set and open the connection
<%
dim DNS_BASE
dim SQL
dim conn
dim rs
DSN_BASE="DBQ=" & Server.Mappath(".")&"/db/paroisse.mdb" & ";Driver={Microsoft Access Driver (*.mdb)};"
' Tu mets le nom de ta table à la place de TATABLE
SQL="select * from HeureMesse"
Set conn=Server.CreateObject("ADODB.connection")
conn.Open DSN_BASE
' Puis tu ouvres ton recordset
Set rs=Server.createObject("ADODB.RecordSet")
set ra.ActiveConnection = conn
RS.Open SQL 'Excécute le SQL
if not RS.eof then
%>
<table border="1" align="center" width="100%">
<tr>
<td class="heures"><b>Paroisse</b></td>
<td class="heures"><b>Lundi</b></td>
<td class="heures"><b>Mardi</b></td>
<td class="heures"><b>Merecredi</b></td>
<td class="heures"><b>Jeudi</b></td>
<td class="heures"><b>Vendredi</b></td>
<td class="heures"><b>Samedi</b></td>
<td class="heures"><b>Dimanche</b></td>
</tr>
<%
do while not RS.eof
'get the fields
paroisse= RS("paroisse")
lundi= RS("lundi")
mardi= RS("mardi")
mercredi= RS("mercredi")
jeudi= RS("jeudi")
vendredu= RS("vendredi")
samedi= RS("samedi")
dimanche= RS("dimanche")
%>
<tr>
<td class="smallfont" valign="top"><%=paroisse%> </td>
<td class="smallfont" valign="top"><%=lundi%> </td>
<td class="smallfont" valign="top"><%=mardi%> </td>
<td class="smallfont" valign="top"><%=jeudi%> </td>
<td class="smallfont" valign="top"><%=vendredi%> </td>
<td class="smallfont" valign="top"><%=samedi%> </td>
<td class="smallfont" valign="top"><%=dimanche%> </td>
</tr>
</form>
<%
mRS.movenext
loop
%>
</table>
<%
end if
'close it all up
RS.close
set RS=nothing
set conn=nothing
%>
</body>
</html>
_________________ P4T-E 1.6g
512 RAM
WinXP
|