I am setting up my website using ASP and an Access database, the site is being hosted, with an option to use DSN, but the recommendation from the hosting company is to use a DSN-less connection.
The following is the configuration for the Access database connection, but I find the code confusing. It seems to use a DSN, but it also seems to use a DSN-less connection since the path to the database is specified. I would greatly appreciate any insights into this, currently, I cannot seem to get the database connection working properly on the hosted site. Thanks !
Here is the code:
Expand|Select|Wrap|Line Numbers
- ' use this connect string for the Access tables
- ' change the following
- ' YourDB to the physical path of your database
- 'strConnect = "Driver={Microsoft Access Driver (*.mdb)} DBQ=C:\inetpub\wwwroot\BegASP\Chapter.14\Contact.mdb"
- 'strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data 'Source=C:\inetpub\wwwroot\share\Contact.mdb;Mode=Share Deny None;Extended Properties="";Jet 'OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet 'OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk 'Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet 'OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy 'Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False"
- 'strConnect = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=Contact;Connect 'Timeout=15;Locale Identifier=1033;DSN=Contact"
- 'DBQ=C:\inetpub\wwwroot\BegASP\Chapter.14\Contact.mdb"
- 'set ObjConn = Server.CreateObject("ADODB.connection")
- 'ObjConn.open ConnStr, "Admin", ""
- ' use this connect string for a DSN data store
- ' change the following
- ' DSN=YourDSNName
- strConnect = "DSN=Users123"