|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ODBC driver problems with Access / ASP
<i><b>Originally posted by : ADEW (asp@adew.co.uk)</b></i><br />I'm having problems getting an ASP file to open up my Access database on both W2000 and W98. The Access is a new install in all cases, and is Access 2000. The error I get on W2000 is listed below:<br /><br />Error Type:<br />Microsoft OLE DB Provider for ODBC Drivers (0x80004005)<br />[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified<br /><br />And the code I am using is (with error line marked):<br /><br /><%<br /> Dim objConnection<br /> <br /> Set objConnection = Server.CreateObject("ADODB.Connection")<br /> objConnection.ConnectionString="DSN=Contacts_Test.dsn"<br /> objConnection.Open ' error at this line<br /> <br /> Dim objRecSet<br /> objRecSet = Server.CreateObject("ADODB.Recordset")<br /> objRecSet.Open "Contacts", objConnection, , , 2<br />%><br /><br />I've also tried non DSn and get the same error. I guess I have not set my system up correctly - but I've no idea how to get around this problem. Can any one suggest a solution??<br />
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : Fredrik (psyk00@chello.se)</b></i><br />well u should allways use DSN-less conn.<br />the error u got is ODBC cannot find it<br />or u dont have accosiated the right driver for<br />the conn.<br />TRY THIS ONE:<br />remember dont include inetpub/wwwroot <br /><br /><%<br />Option Explicit<br />Response.Buffer = True<br />dim conn<br />dim rs<br />dim strID<br />dim strconn<br /><br />strconn = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & Server.MapPath("/database.mdb")<br />set conn = server.createobject("adodb.connection")<br />conn.open strconn<br /><br />set rs = server.createobject("adodb.recordset")<br />rs.open "TABLEname", conn, 2, 2<br />%> <br /><br /><br />if this dosent work for u then u dont have the<br />necesary files installed<br /><br />
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > ODBC driver problems with Access / ASP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|