11 Methods of ASP Connection database _javascript skills

Source: Internet
Author: User

ASP Connection Database 11 ways--This article summarizes the use of ASP linked to a variety of database methods:
1.Access Database dsn-less connection method:

Set Adocon=server.createobject ("Adodb.connection")
adoconn. Open "Driver={microsoft Access Driver (*.mdb)};D bq=" & _
Server.MapPath ("Path to Database")


2.Access OLE db connection method:

Set Adocon=server.createobject ("Adodb.connection")
adocon.open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data source=" & Server.MapPath ("Path to Database")

3.SQL Server Connection method:

Set Adocon=server.createobject ("Adodb.recordset")
ADOcon. Open "Driver={sql Server}; server= (local); uid=***; pwd=***; " & _
"database= database name;"

4.SQL Server OLE db connection method:

Set Adocon=server.createobject ("Adodb.connection")
adocon.open "Provider=SQLOLEDB.1;Data Source=RITANT4;" & _
"User id=***; password=***; " & _
"inital catalog= database name"

5.Oracle Connection method:

Set Adocon=server.createobject ("Adodb.connection")
Adocon.open "Driver={microsoft ODBC for oracle};server= Oraclesever.world;uid=admin;pwd=pass; "


6.Oracle OLE DB connection method:

Set Adocon=server.createobject ("Adodb.connection")
adocon.open "Provider=oraoledb.oracle;data source=dbname; User Id=admin;password=pass; "

7.dBase Connection method:

Set Adocon=server.createobject ("Adodb.connection")
adocon.open "Driver={microsoft dbase Driver (*.dbf)}; Driverid=277;dbq=------------; "


8.mySQL Connection method:

Set Adocon=server.createobject ("Adodb.connection")
adocon.open "Driver={mysql}";d atabase=yourdatabase;
uid=username;pwd=yourpassword;option=16386; "


9.Visual Foxpro Connection method:

Set Adocon=server.createobject ("Adodb.connection")
adocon.open "Driver={microsoft Visual Foxpro Driver}; SOURCETYPE=DBC;SOURCEDB=*.DBC; Exclusive=no; "


10.MS Text connection method:

Set Adocon=server.createobject ("Adodb.connection")
adocon.open "Driver={microsoft text Driver (*.txt; *.csv)}; dbq=-----; " &_
"Extensions=asc,csv,tab,txt; Persist Securityinfo=false; "


11.MS Text OLE DB connection method:

Set Adocon=server.createobject ("Adodb.connection")
adocon.open "Provider=microsof.jet.oledb.4.0;data source= Your_path; " &_
"Extended Properties" text; Fmt=delimited ' "

The above is 11 kinds of ASP Connection database method, hope for everyone's learning help.

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.