一。数据库的连接方法:%dimconn,mdbfilemdbfile=server.mappath(数据库名称.mdb)setconn=server.createobject(adodb.connection)conn.opendriver={microsoftaccessdriver(*.mdb)};uid=admin;pwd=数据库密码;dbq=&mdbfile%2.ASP与SQL数据库连接:%dimconnsetconn=server.createobject(ADODB.connection)con.openPROVIDER=SQLOLEDB;DATASOURCE=SQL服务器名称或IP地址;UID=sa;PWD=数据库密码;DATABASE=数据库名称%1.Access数据库的DSN-less连接方法:setadocon=Server.Createobject(adodb.connection)adoconn.OpenDriver={MicrosoftAccessDriver(*.mdb)};DBQ=&_Server.MapPath(数据库所在路径)2.AccessOLEDB连接方法:setadocon=Server.Createobject(adodb.connection)adocon.openProvider=Microsoft.Jet.OLEDB.4.0;&_DataSource=&Server.MapPath(数据库所在路径)3.SQLserver连接方法:setadocon=server.createobject(adodb.recordset)adocon.OpenDriver={SQLServer};Server=(Local);UID=***;PWD=***;&_database=数据库名;4.SQLserverOLEDB连接方法:setadocon=Server.Createobject(adodb.connection)adocon.openprovider=SQLOLEDB.1;DataSource=RITANT4;&_userID=***;Password=***;&_initalCatalog=数据库名5.Oracle连接方法:setadocon=Server.Createobject(adodb.connection)adocon.openDriver={microsoftodbcfororacle};server=oraclesever.world;uid=admin;pwd=pass;6.OracleOLEDB连接方法:setadocon=Server.Createobject(adodb.connection)adocon.openProvider=OraOLEDB.Oracle;datasource=dbname;userid=admin;password=pass;7.dBase连接方法:setadocon=Server.Createobject(adodb.connection)adocon.openDriver={microsoftdbasedriver(*.dbf)};driverid=277;dbq=------------;8.mySQL连接方法:setadocon=Server.Createobject(adodb.connection)adocon.openDriver={mysql};database=yourdatabase;uid=username;pwd=yourpassword;option=16386;9.VisualFoxpro连接方法:setadocon=Server.Createobject(adodb.connection)adocon.openDriver={microsoftVisualFoxprodriver};sourcetype=DBC;sourceDB=*.dbc;Exclusive=No;10.MStext连接方法:setadocon=Server.Createobject(adodb.connection)adocon.openDriver={microsofttextdriver(*.txt;*.csv)};dbq=-----;&_extensions=asc,csv,tab,txt;PersistSecurityInfo=false;11.MStextOLEDB连接方法:setadocon=Server.Createobject(adodb.connection)adocon.openProvider=microsof.jet.oledb.4.0;datasource=your_path;&_ExtendedProperties'text;FMT=Delimited'