Access Databases
Q.) How do I create a dsn-less connection to my Access database using vbscript?
A.) Here is a sample that assumes you have the databas in the "DATA" folder and named it "database1.mdb". Change this script as needed.
Set objCXN = Server.CreateObject("ADODB.Connection")
strPath = Server.MapPath("/DATA/database1.mdb")
strCXN = "Microsoft.Jet.OLEDB.4.0;Data Source=" & strPath & ";User ID=;Password=;"
objCXN.Open strCXN
.
.
objCXN.Close
Set objCXN = Nothing
Q.) Is there any charge for using an Access database?
A.) No charge. The nice thing about Access is that it is free, and also that it is file based so that you can simply copy the file to the webserver with you website.
The downside of Access is that it really is not designed to be used by many users at one time, and we have seen many issues with websites getting locked up due to the use of Access. SQL Server databases are much better suited for websites than Access.
Q.) My web site uses an Access database and has started hanging up. What's going on?
A.) You should download the ".mdb" file via FTP back to your computer, and run the Access "Compact and Repair" function on your database.
Then upload the ".mdb" file back to your site.
It is recommended that you keep a backup of the database file before running the Compact and Repair function.
This is not the only possible cause, but we have seen the database become corrupt, and this should be attempted to rule out a damaged database.