Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Errror with DB location path !!
Old 07-07-2004, 06:00 PM Errror with DB location path !!
VegaLA's Avatar
Skilled Talker

Posts: 64
Trades: 0
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...
VegaLA is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-07-2004, 06:38 PM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
Trades: 0
Mitch,

Absolutely right. An ADO connection string requires a fully qualified path, even on your web server.
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Old 07-07-2004, 06:42 PM
VegaLA's Avatar
Skilled Talker

Posts: 64
Trades: 0
Cheers Kyrnt, typing the full path has resolevd that problem, but produced another error

"

Microsoft JET Database Engine error '80004005'

Not a valid file name.

/lesson1.asp, line 20

"

and line 20 is cnn.open(cnnstring)

Any ideas ?
VegaLA is offline
Reply With Quote
View Public Profile
 
Old 07-07-2004, 06:44 PM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
Trades: 0
Actually, it looks like the same problem because it is telling you that it cannot find the Access file that you are trying to open (i.e., the path may be wrong or incomplete). Reverify that value - debug it to your screen to make absolutely sure.
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Old 07-07-2004, 09:01 PM
VegaLA's Avatar
Skilled Talker

Posts: 64
Trades: 0
Aha.... thanks again Kyrnt,
I have changed the path and it is now playing ball.
VegaLA is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Errror with DB location path !!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.66789 seconds with 12 queries