|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ADO Connection to an Access Database not located on Web Server
<i><b>Originally posted by : Jeff Wells (jeff.wells@mencap.org.uk)</b></i><br />I'm having difficulty getting my .asp pages to connect to an Access Database which is located on a different server to the web server the pages are running on. Here's the essential code and error message. Can anyone help?<br /><br /><%@ Language=VBScript %><br /><%<br />Set DataConn = Server.CreateObject("ADODB.Connection")<br /> <br />Set rs = server.CreateObject("ADODB.Recordset")<br /> <br />DataConn.ConnectionTimeout = Session("DataConn_ConnectionTimeout")<br />DataConn.CommandTimeout = Session("DataConn_CommandTimeout")<br /><br />'This points to a virtual directory (NC_Telephone_Exts) on the Web Server <br />' which points to the other server (\Golden) - doesn't work<br />'DataConn.Open "DBQ="+server.mappath("NC_Telephone_Exts elephonelist.mdb")+";Driver={Microsoft Access Driver (*.mdb)};", Session("DataConn_RuntimeUserName"), Session("DataConn_RuntimePassword")<br /><br />'This is a physical path to the other server - doesn't work<br />'DataConn.Open "DBQ="+"\GoldenNC1FDataPLUAccess elephonelist.mdb"+";Driver={Microsoft Access Driver (*.mdb)};", Session("DataConn_RuntimeUserName"), Session("DataConn_RuntimePassword")<br /><br />'This points to a mapped drive on the web server itself pointing at \Golden - doesn't work<br />'DataConn.Open "DBQ=M: elephonelist.mdb"+";Driver={Microsoft Access Driver (*.mdb)};", Session("DataConn_RuntimeUserName"), Session("DataConn_RuntimePassword")<br /><br />'These point to the other server (\Golden) -don't work<br />'DataConn.open "FILEDSN=NC_TELE","",""<br />'DataConn.open "DSN=NC_TELE_DSN","",""<br /><br />'This points to a copy of the database located on the Web Server itself - does work<br />'DataConn.Open "DBQ="+server.mappath("telephonelist.mdb")+";Driver={Microsoft Access Driver (*.mdb)};", Session("DataConn_RuntimeUserName"), Session("DataConn_RuntimePassword")<br /><br /><br />str1 = "Select * from qryA2E"<br /><br />rs.Open str1, DataConn, 3<br /><br />%><br /><br />' All of the above produce the same error message:<br /><br />"Microsoft OLE DB Provider for ODBC Drivers error '80004005' <br /><br />[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path. <br />Make sure that the path name is spelled correctly and that you are connected to<br />the server on which the file resides." <br />
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : steve</b></i><br />instead of a mapped network drive letter try a unc path \servernamesharenamedbname<br /><br /><br />------------<br />Jeff Wells at 6/12/2000 9:28:19 AM<br /><br />I'm having difficulty getting my .asp pages to connect to an Access Database which is located on a different server to the web server the pages are running on. Here's the essential code and error message. Can anyone help?<br /><br /><%@ Language=VBScript %><br /><%<br />Set DataConn = Server.CreateObject("ADODB.Connection")<br /> <br />Set rs = server.CreateObject("ADODB.Recordset")<br /> <br />DataConn.ConnectionTimeout = Session("DataConn_ConnectionTimeout")<br />DataConn.CommandTimeout = Session("DataConn_CommandTimeout")<br /><br />'This points to a virtual directory (NC_Telephone_Exts) on the Web Server <br />' which points to the other server (\Golden) - doesn't work<br />'DataConn.Open "DBQ="+server.mappath("NC_Telephone_Exts elephonelist.mdb")+";Driver={Microsoft Access Driver (*.mdb)};", Session("DataConn_RuntimeUserName"), Session("DataConn_RuntimePassword")<br /><br />'This is a physical path to the other server - doesn't work<br />'DataConn.Open "DBQ="+"\GoldenNC1FDataPLUAccess elephonelist.mdb"+";Driver={Microsoft Access Driver (*.mdb)};", Session("DataConn_RuntimeUserName"), Session("DataConn_RuntimePassword")<br /><br />'This points to a mapped drive on the web server itself pointing at \Golden - doesn't work<br />'DataConn.Open "DBQ=M: elephonelist.mdb"+";Driver={Microsoft Access Driver (*.mdb)};", Session("DataConn_RuntimeUserName"), Session("DataConn_RuntimePassword")<br /><br />'These point to the other server (\Golden) -don't work<br />'DataConn.open "FILEDSN=NC_TELE","",""<br />'DataConn.open "DSN=NC_TELE_DSN","",""<br /><br />'This points to a copy of the database located on the Web Server itself - does work<br />'DataConn.Open "DBQ="+server.mappath("telephonelist.mdb")+";Driver={Microsoft Access Driver (*.mdb)};", Session("DataConn_RuntimeUserName"), Session("DataConn_RuntimePassword")<br /><br /><br />str1 = "Select * from qryA2E"<br /><br />rs.Open str1, DataConn, 3<br /><br />%><br /><br />' All of the above produce the same error message:<br /><br />"Microsoft OLE DB Provider for ODBC Drivers error '80004005' <br /><br />[Microsoft][ODBC Microsoft Access Driver] '(unknown)' is not a valid path. <br />Make sure that the path name is spelled correctly and that you are connected to<br />the server on which the file resides." <br />
|
![]() |
| Viewing: ASP Free Forums > Programming > ASP Development > ADO Connection to an Access Database not located on Web Server |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|