ASP连接Access数据库(DSN-less连接方法): set adocon=Server.Createobject(“adodb.connection”) adoconn.Open”Driver={Microsoft Access Driver(*.mdb)};DBQ=”&_Server.MapPath(“数据库所在路径”)
ASP连接Access数据库( OLE DB连接方法): set adocon=Server.Createobject(“adodb.connection”) adocon.open”Provider=Microsoft.Jet.OLEDB.4.0;”&_”Data Source=” & Server.MapPath(“数据库所在路径”)
ASP连接SQL server的方法: set adocon=server.createobject(“adodb.recordset”) adocon.Open”Driver={SQL Server};Server=(Local);UID=;PWD=;”& _”database=数据库名;”
ASP连接SQL server 通过 OLE DB连接方法: set adocon=Server.Createobject(“adodb.connection”) adocon.open”provider=SQLOLEDB.1;Data Source=RITANT4;”&“user ID=*;Password=*;”&“inital Catalog=数据库名”
ASP与Oracle数据库的连接方法: set adocon=Server.Createobject(“adodb.connection”) adocon.open”Driver={microsoft odbc for oracle};server=oraclesever.world;uid=admin;pwd=pass;”
ASP与Oracle数据库的 OLE DB 连接方法: set adocon=Server.Createobject(“adodb.connection”) adocon.open”Provider=OraOLEDB.Oracle;data source=dbname;user id=admin;password=pass;”
ASP连接dBase数据库方法: set adocon=Server.Createobject(“adodb.connection”) adocon.open”Driver={microsoft dbase driver(*.dbf)};driverid=277;dbq=——–;”
ASP连接mySQL数据库的方法: set adocon=Server.Createobject(“adodb.connection”) adocon.open”Driver={mysql};database=yourdatabase;uid=username;pwd=yourpassword;option=16386;”
ASP连接Visual Foxpro数据库的方法: set adocon=Server.Createobject(“adodb.connection”) adocon.open”Driver={microsoft Visual Foxpro driver};sourcetype=DBC;sourceDB=*.dbc;Exclusive=No;”
ASP连接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;”
ASP连接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’”
|