Jump to content

dsn less connection with access database


dsci2000
 Share

Recommended Posts

Hi,I inserted in my site an ASP page where I try to connect with an Access database without a DSN. Bellow the code I used in my page:" objconn = Server.createObject("ADODB.connection"); strcon = "Provider=Microsoft.Jet.OLEDB.4.0; DataSource=" & Server.MapPath("mdb-database/riviera.mdb"); objconn.Open(strcon);"but when it run this is the result:"Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified /MaintManage.asp, line 150 "Is it possible the provider doesn't support this connection type? Or is the code wrong? Thneks for help?bye

Link to comment
Share on other sites

set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open(Server.Mappath("/your/database/path.mdb"))or set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "D:\your database path "

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...