How to use five DSN

zhaozj2021-02-11  193

The first method of using five DSNs first - this method is used in Access StrConn = "Driver = Microsoft Access Driver (* .mdb); DBQ =" & Server.MAppath ("aspfree.mdb") set conn = server .CreateObject ("AdoDb.Connection" Conn.open Strconn

Second - this method is used in SQL Server multiple strConn = "driver = {SQL Server}; description = SqlDemo; server = 127.0.0.1; uid = loginid; pwd = password; database = dataBase_name set conn = server.createObject ("AdoDb.Connection") Conn.open Strconn

Third StrConn = "driver = {microsoftAccessDriver (*. Mdb)}; dbq = f: /inetpub/wwwroot/somedir/db1.mdb; defaultdir = f: / inetpub / wwwroot / somedir; uid = loginid; pwd = password DriverId = 25; FIL = MsAccess; "SET CONN = Server.createObject (" AdoDb.Connection "Conn.open StrConn

The fourth type of system data source The Following Uses a data source name:

set conn = server.createobject ( "adodb.connection") conn.open "Example" 'This is created in the Control Panel using the 32 bit ODBC Driver. If you do not know how to setup here is a perfect example on ActiveServerPages .com (Click Here to File DSN's!

The fifth use ODBC data source, the premise is that you must set up the data source set RS = Server.CreateObject ("AdoDb.Recordset") RS.Open "TBLNAME", "DSNName", "DSNName", "DSNNAME", "DSNNAME", "DSNNAME", "DSNNAME", 3, 3

转载请注明原文地址:https://www.9cbs.com/read-4156.html

New Post(0)