MrAdam Posted December 9, 2006 Share Posted December 9, 2006 i've tried to create an ASP file that connects to an access database, but, when it tries it gives me an error saying that the database is not a 'jet' database. im using microsoft access 2000 with probably the default settings for everything.can i change access to create JET databases?-thanks Link to comment Share on other sites More sharing options...
Mr.Jay Posted December 9, 2006 Share Posted December 9, 2006 create a new file, call it connection.asp or what ever you like,then include the file on all pages that will use the database.paste this in your new file: <%'-----------------------------------------------------------'###########################################################var_db_path = "your database path"'###########################################################'-----------------------------------------------------------' set the database connectionset db = server.createobject("adodb.connection")' open database connectiondb.open "driver={microsoft access driver (*.mdb)};" & _ "dbq=" & server.mappath(var_db_path) ' set the recordsetset rs = server.createobject("adodb.recordset")%> then, in your page you can do something like this. <%set rs = db.execute("select * from table")%> hope this helps Link to comment Share on other sites More sharing options...
zletian Posted December 15, 2006 Share Posted December 15, 2006 <%'-----------------------------------------------------------'###########################################################var_db_path = "your database path"'###########################################################'-----------------------------------------------------------' set the database connectionset db = server.createobject("adodb.connection")' open database connectiondb.open "provider=microsoft.jet.oledb.4.0 ; data source="&server.mappath(var_db_path)' set the recordsetset rs = server.createobject("adodb.recordset")%>then, in your page you can do something like this.CODE<%set rs = db.execute("select * from table")%> Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now