1. Even ACCESS:conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & Server.MapPath ("/db/database.mdb")
This method of using a relative path to the root directory solves the problem of sharing a conn.asp file across the site, but note that this method is not suitable for sites under the virtual directory when debugging locally.
2. Even SQL SERVER:cnn.open "Provider=sqloledb;data source=127.0.0.1;initial catalog=db; User Id=user; Password=pwd; "
3. If it is an Access database, preferably a folder outside the site directory to prevent downloading, this method is most suitable for the virtual host Web site, the program is placed under the WWW folder, the database is placed under the Databases folder.
4. If you cannot use DSN to connect or put into a folder outside the site, it is recommended that the database should be a complex name and add the # character, so that better prevent the download, in addition to the. asp is also unsafe, so easy to execute the submission of ASP code, suggested file name: *#*.mdb
5. The safest way: When the site is all done, the first line in the conn.asp file plus on Error Resume Next