ASP connection method of database

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.