Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datapath error WHY? ADO

Status
Not open for further replies.

seanybravo

IS-IT--Management
Sep 24, 2003
89
GB
Hi All

Could someone please shed some light in why I am getting the error below? I am tryinig to set up a include file that connects to a database when a pathname is passed to it. The code worked before I put it into a sub. It does not seam to like the passed path as I had to a s Cstr function for it to accept it to map the full pathname.

Many thanks

Sean

Include file:

<%
'Include file for the new master Category connect to the database

Sub UpdateCategory(dbDatabasePath)
Dim strPhysicalPath
'Find the physical path of the data base
strPhysicalPath = Server.mappath(Cstr(dbDatabasePath))

MM_ConnWokingCat_STRING="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strPhysicalPath

set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_ConnWokingCat_STRING
Recordset1.Source = "SELECT * FROM tblCategory ORDER BY fldDefinition"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
end sub
%>

----------------------------------------------------

ASP file:

The Call after the INclude
<!-- #INCLUDE FILE="../../../Code/masterCatConnect.inc" -->
<% UpdateCategory "Database/MasterCategory.mdb" %>

ERROR:
Microsoft JET Database Engine error '80004005'
'E:\Websites\ebusinessdirectories\businessdirectories\Pages\BromleyBD2004\Database\MasterCategory.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.
E:\WEBSITES\EBUSINESSDIRECTORIES\BUSINESSDIRECTORIES\PAGES\BROMLEYBD2004\../../../Code/masterCatConnect.inc, line 12
 
Thank you for you reply.

Thats the problem I the data path in the error is correct. Thats why I cant work out where I am going wrong.

Am I formatting the connection string wrong in some way?

Sean
 
Sean

Try hard coding your path first and check if that works. If so the problem could be with the parameter being passed.

Also do a
Code:
Response.Write strPhysicalPath
and see what it shows.

Satish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top