|
I'm just playing with web based DB at the moment. I am having probs however with this code at the dblocat line.
It works fine from DW when I code the path to C:\inetub\wwwroot\data\intranet.mdb and preview it in IE but changing the path to just data\intranet.mdb in the asp file which is in the folder above data folder produces the error i've pasted at the bottom...
"
<%
Dim dblocat, cnn, cnnstring, rs, SQL
dblocat = "\data\intranet.mdb"
set cnn = server.CreateObject("ADODB.Connection")
cnnstring = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & dblocat
cnn.open(cnnstring)
Set rs = server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = cnn
SQL= "SELECT * From departmental"
rs.Open SQL
rs.MoveFirst
%>
<table border="0" cellspacing="0" cellpadding="0" align="center" width="80%">
<tr> <td><b>Title</b></td> <td><b>Author</b></td> <td><b>Date</b></td> </tr>
<tr><td></td><td></td><td></td></tr>
<%
while not rs.EOF ' Keep going until all of the records have been displayed.
%>
<tr><td><%=rs("Title")%></td> <td><%=rs("Author")%></td>
<td><%=rs("Date")%></td>
<%
'Now, move to the next record & start again.
rs.MoveNext
wend
%>
"
However, when I look at it on the website I get this error message....
Microsoft JET Database Engine error '80004005'
'c:\data\intranet.mdb' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.
/lesson1.asp, line 20
Mitch...
|