摘要:asp连接access,mssql,Oracle,mysql数据库语法
1.Access:
setadocon=Server.Createobject(\"adodb.connection\")adoconn.Open\"Driver={MicrosoftAccessDriver(*.mdb)};DBQ=\"&_Server.MapPath(\"数据库相对路径\")
2.AccessOLEDB:
setadocon=Server.Createobject(\"adodb.connection\")adocon.open\"Provider=Microsoft.Jet.OLEDB.4.低;\"&_\"DataSource=\"&Server.MapPath(\"数据库相对路径\")
3.SQLserver:
setadocon=server.createobject(\"adodb.recordset\")adocon.Open\"Driver={SQLServer};Server=(Local);UID=***;PWD=***;\"&_\"database=数据库名;\"
4.SQLserverOLEDB:
setadocon=Server.Createobject(\"adodb.connection\")adocon.open\"provider=SQLOLEDB.1;DataSource=RITANT4;\"&_\"userID=***;Password=***;\"&_\"initalCatalog=数据库名\"
5.Oracle:
setadocon=Server.Createobject(\"adodb.connection\")adocon.open\"Driver={microsoftodbcfororacle};server=oraclesever.world;uid=admin;pwd=pass;\"
6.OracleOLEDB:
setadocon=Server.Createobject(\"adodb.connection\")adocon.open\"Provider=OraOLEDB.Oracle;datasource=dbname;userid=admin;password=pass;\"
7.mySQL连接方法:
setadocon=Server.Createobject(\"adodb.connection\")adocon.open\"Driver={mysql};database=yourdatabase;uid=username;pwd=yourpassword;option=16386;\"