seanybravo
IS-IT--Management
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
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