ASP串連各類資料庫的語句

來源:互聯網
上載者:User
1.Access資料庫的DSN-less串連方法:

set adocon=Server.Createobject("adodb.connection")

adoconn.Open"Driver={Microsoft Access Driver(*.mdb)};DBQ="& _

Server.MapPath("資料庫所在路徑")

2.Access OLE DB串連方法:

set adocon=Server.Createobject("adodb.connection")

adocon.open"Provider=Microsoft.Jet.OLEDB.4.0;"& _

"Data Source=" & Server.MapPath("資料庫所在路徑")

3.SQL server串連方法:

set adocon=server.createobject("adodb.recordset")

adocon.Open"Driver={SQL Server};Server=(Local);UID=***;PWD=***;"& _

"database=資料庫名;"

4.SQL server OLE DB串連方法:

set adocon=Server.Createobject("adodb.connection")

adocon.open"provider=SQLOLEDB.1;Data Source=RITANT4;"& _

"user ID=***;Password=***;"& _

"inital Catalog=資料庫名"

5.Oracle 串連方法:

set adocon=Server.Createobject("adodb.connection")

adocon.open"Driver={microsoft odbc for oracle};server=oraclesever.world;uid=admin;pwd=pass;"

6.Oracle OLE DB 串連方法:

set adocon=Server.Createobject("adodb.connection")

adocon.open"Provider=OraOLEDB.Oracle;data source=dbname;user id=admin;password=pass;"

7.dBase 串連方法:

set adocon=Server.Createobject("adodb.connection")

adocon.open"Driver={microsoft dbase driver(*.dbf)};driverid=277;dbq=------------;"

8.mySQL 串連方法:

set adocon=Server.Createobject("adodb.connection")

adocon.open"Driver={mysql};database=yourdatabase;uid=username;pwd=yourpassword;option=16386;"

9.Visual Foxpro 串連方法:

set adocon=Server.Createobject("adodb.connection")

adocon.open"Driver={microsoft Visual Foxpro driver};sourcetype=DBC;sourceDB=*.dbc;Exclusive=No;"

10.MS text 串連方法:

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 串連方法:

set adocon=Server.Createobject("adodb.connection")

adocon.open"Provider=microsof.jet.oledb.4.0;data source=your_path;"&_

"Extended Properties'text;FMT=Delimited'"

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.