Summary: CONNECTION Daquan

xiaoxiao2021-03-06  61

1.SQLSERVER A.ODBC I.Standard Security: "driver = {SQL Server}; server = aron1; database = public; uid = sa; pwd = asdasd;" ii.trusted connection: "driver = {sql server}; server = {SQL Server}; server = Aron1; Database = pubs; Trusted_Connection = yes; "III.Prompt for username and password: oConn.Properties (" Prompt ") = adPromptAlways oConn.Open" Driver = {SQL Server}; Server = Aron1; DataBase = pubs; " B.OLE DB, OleDbConnection (.NET) I.Standard Security: "Provider = sqloledb; Data Source = Aron1; Initial Catalog = pubs; User Id = sa; Password = asdasd;" II.Trusted Connection: "Provider = sqloledb; Data Source = Aron1; Initial Catalog = pubs; Integrated Security = SSPI; "(only for Sqlserver 2000) III.Prompt for username and password: oConn.Provider =" sqloledb "oConn.Properties (" Prompt ") = adPromptAlways oConn. "Data source = aron1; initial catalog = public;" iv.connect via an ip address: "provider = sqloledb; data source = 190.190.200.100, 1433; network library = d BMSSOCN; Initial Catalog = Pubs; User ID = SA; Password = Asdasd; "C. SqlConnection (.NET) I.Standard Security:" Data Source = aron1; initial catalog = pubs; user ID = sa; password = asdasd; " or "Server = Aron1; Database = pubs; User ID = sa; Password = asdasd; Trusted_Connection = False" II.Trusted Connection: "Data Source = Aron1; Initial Catalog = pubs; Integrated Security = SSPI;" or "Server = Aron1 Database = PUBS; Trusted_Connection = true; "

(Applies only Sqlserver 2000) III.Connect via an IP address: "Data Source = 190.190.200.100,1433; Network Library = DBMSSOCN; Initial Catalog = pubs; User ID = sa; Password = asdasd;" Name Network library dbnmpntw Win32 Named Pipes dbmssocn Win32 Winsock TCP / IP dbmsspxn Win32 SPX / IPX dbmsvinn Win32 Banyan Vines dbmsrpcn Win32 Multi-Protocol (Windows RPC) by SQLOLEDB provider connection with the Network Library = dbmssocn, connected through MSDASQL provider, with Network = dbmssocn IV. statement method : C #: using System.Data.SqlClient; SqlConnection oSQLConn = new SqlConnection (); oSQLConn.ConnectionString = "my connectionstring"; oSQLConn.Open (); VB.NET: Imports System.Data.SqlClient Dim oSQLConn As SqlConnection = New SqlConnection () oSQLConn.ConnectionString = "my connectionstring" oSQLConn.Open () D.Data Shape MS Data Shape "Provider = MSDataShape; Data Provider = SQLOLEDB; Data Source = Aron1; Initial Catalog = pubs; User ID = sa; Password = asdasd; "Oh, Data Shape has been used, please refer to http://www.4guysfromrolla.com/webtech/092599-1.shtml2.access a.odbc I.standard Security:" driver = {Microsoft Access Driver (* .mdb)}; dbq = c: /mydatabase.mdb; uid = admin; pwd =; "II.Workgroup:" driver = {Microsoft Access driver (* .mdb)}; dbq = c: /mydatabase.mdb; systemdb; = C: /MyDatabase.mdw; "III.ExClusive:" driver = {Microsoft Access Driver (* .mdb)}; dbq = c: /mydatabase.mdb; Exclusive = 1; UID = admin; pwd = "

B. OLE DB, OLEDBCONNECTION (.NET) I.Standard Security: "provider = microsoft.jet.OLEDb.4.0; data source = / somepath / mydb.mdb; user ID = admin; password =;" II.Workgroup (system Database): "provider = microsoft.jet.Oledb.4.0; data source = / somepath / mydb.mdb; jet oledb: system data = system.mdw;" iii.with Password: "provike = microsoft.jet.oledb.4.0 Data Source = / SomePath / mydb: Database password = mydbpassword; "3.Oracle a.odbc i.new version:" driver = {microsoft {microsoft odbc for oracle}; server = oracleserver.world; uid = username ; Pwd = asdasd; "II.OLD VERSION:" Driver = {Microsoft Odbc Driver for oracle}; connection = oracleserver.world; uid = myusername; pwd = mypassword; "B.OLE DB, OLEDBCONNECTION (.NET) I.Standard Security: "provider = msdara; data source = myoracledb; user ID = username; password = asdasd;" Note: The above is driven by MS, below is the driver provided with Oracle: "Provider = oraoledb.oracle; data source = myoracledb User ID = Username; Password = Asdas D; "II.Trusted Connection:" provike = oraoledb.racle; data source = myoracledb; osauthent = 1; "C. ORACLECONNECTION (.NET) I.Standard:" Data Source = Oracle8i; Integrated Security = YES "; Note: This method is used for Oracle 8i Release 3 and above.

Statement Method: C #: using System.Data.OracleClient; OracleConnection oOracleConn = new OracleConnection (); oOracleConn.ConnectionString = "my connectionstring"; oOracleConn.Open (); VB.NET: Imports System.Data.OracleClient Dim oOracleConn As OracleConnection = New OracleConnection () oOracleConn.ConnectionString = "my connectionstring" oOracleConn.Open () D.Data Shape I.MS Data Shape: "Provider = MSDataShape.1; Persist Security Info = False; Data Provider = MSDAORA; Data Source = orac; User ID = username; password = mypw "3.mysql a.odbc i.local database:" driver = {mysql}; server = mysrvname; option = 16834; Database = myDatabase; "II.Remote Database:" driver = {mysql }; Server = data.domain.com; port = 3306; option = 131072; STMT =; Database = my-data; uid = username; pwd = password; "B.ole DB, OLEDBConnection (.NET) I.Standard: "Provider = mysqlprov; data source = mydb; user id = username; password = asdasd;" c.mysqlconnection (.net) I.EIN FODESIGNS.DBPROVIDER: "Data Source = Server; Database = MYDB; User ID = UserName; Password = PWD; Command Logging = false" Note: This write is only used by Einfodesigns DBProvider connection: II. declared: C #: USING EINFODESIGNS. dbProvider.MySqlClient; MySqlConnection oMySqlConn = new MySqlConnection (); oMySqlConn.ConnectionString = "my connectionstring"; oMySqlConn.Open (); VB.NET: Imports eInfoDesigns.dbProvider.MySqlClient Dim oMySqlConn As MySqlConnection =

New MySqlConnection () oMySqlConn.ConnectionString = "my connectionstring" oMySqlConn.Open () 4.Interbase A.ODBC (Easysoft ODBC-Interbase driver) I.Local computer: "Driver = {Easysoft IB6 ODBC}; Server = localhost; Database = localhost: C: /mydatabase.gdb; Uid = username; Pwd = password "II.Remote Computer:" Driver = {Easysoft IB6 ODBC}; Server = ComputerName; Database = ComputerName: C: /mydatabase.gdb; Uid = username; pwd = password "B.ODBC (Intersolv ODBC-Interbase driver) I.Local computer:" Driver = {INTERSOLV InterBase ODBC Driver (* .gdb)}; Server = localhost; Database = localhost: C: /mydatabase.gdb; Uid = username; Pwd = password "II.Remote Computer:" Driver = {INTERSOLV InterBase ODBC Driver (* .gdb)}; Server = ComputerName; Database = ComputerName: C: /mydatabase.gdb; Uid = username; Pwd = password " C.OLE DB (SibProvider Driver) I.Standard: "provider = sibprovider; location = localhost:; data source = c: /databases/gdbs/mygdb.gdb;user id = sysdba; password = masterkey" i I.Specifying character set: "provider = sibprovider; location = localhost:; data source = c: /databases/gdbs/mygdb.gdb;user id = SYSDBA; password = masterkey; character set = ISO8859_1" III.Specifying role: " Provider = sibprovider; location = localhost:; data source = c: /databases/gdbs/mygdb.gdb;user id = sysdba; password = manskey; role = digitadores "6.ibm DB2 A.OLE DB, OLEDBCONNECTION (.NET) From MS I.TCP / IP: "Provider = DB2OLDB; Network Transport Library = TCPIP; Network Address = xxx.xxx.xxx.xxx;

Initial Catalog = MyCtlg; Package Collection = MyPkgCol; Default Schema = Schema; User ID = MyUser; Password = MyPW "II.APPC:" Provider = DB2OLEDB; APPC Local LU Alias ​​= MyAlias; APPC Remote LU Alias ​​= MyRemote; Initial Catalog = MyCtlg; Package Collection = MyPkgCol; Default Schema = Schema; User ID = MyUser; Password = myPW "7.Sybase A.ODBC I.Standard Sybase System 12 (or 12.5) Enterprise Open Client:" Driver = {SYBASE ASE ODBC Driver} SRVR = aron1; uid = username; pwd = password "II.Standard Sybase System 11:" driver = {Sybase System 11}; SRVR = aron1; uid = username; pwd = password; "III.Intersolv 3.10:" driver = {INTERSOLV 3.10 32-BIT Sybase}; Srvr = Aron1; Uid = username; Pwd = password; "IIII.Sybase SQL Anywhere (former Watcom SQL ODBC driver):" ODBC; Driver = Sybase SQL Anywhere 5.0; DefaultDir = c: / DBFolder /; dbf = c: /mydatabase.db; uid = username; pwd = password; dsn = "" "" B. Oledb I.adaptive server anywhere (ASA): "provider = asaprov; data source = myasa" II .Adaptive server enterprise (ASE) with Data Source .IDS file: "Provider = Sybase ASE OLE DB Provider; Data source = myASE" Note: you must first create a Data Source .IDS file III.Adaptive Server Enterprise (ASE) with Data Administrator: "Provider = Sybase.ASEOLEDBProvider; SRVR = MyaseServer, 5000; Catalog = MyDBName; user ID = username; password = password "8.informix a.odbc I.informix 3.30:" DSN = ''; driver = {Informix 3.30 32 bit}; host = hostname; server = MyServer; service = service-name; protocol = olsoctcp;

Database = mydb; uid = username; pwd = mypwd Ii.informix-cli 2.5: "driver = {informix-cli 2.5 (32 bit)}; server = myserver; database = myDb; uid = username; pwd = mypwd" B. OLE DB I.IBM Informix OLE DB Provider: "Provider = Ifxoledbc.2; password = myPw; User ID = myUser; Data Source = dbName @ serverName; Persist Security Info = true" 9.Mimer SQL A.ODBC I.Standard Security : "Driver = {mimer}; database = mydb; uid = myuse; pwd = mypw;" ii. Prompt for username and password: "driver = {mimer}; Database = mydb;" 10.dsn a.odbc i.dsn : "DSN = MyDSN; UID = Username; PWD =;" II.File DSN: "FileDSN = C: /MYDATA.DSN; UID = UserName; PWD =;" 11.Excel A.odbc I.Standard: "driver = {Microsoft Excel Driver (* .xls)}; driverid = 790; DBQ = C: /MYXCEL.XLS; defaultdir = c: / mypath; "B.OLE DB I.Standard:" provider = microsoft.jet.Oledb.4.0 Data Source = C: /MYEXCEL.XLS; Extended Properties = "" Excel 8.0; HDR = YES; IMEX = 1 "" "" HDR = YES; "IMEX = 1" iMEX = 1 "TELLS THE Driver to always read "intermixed" Data columns as text.12.text a.odbc i.standard: "driver = {microsoft text driver (* .txt; * .csv)}; dbq = c: / txtfilesfolder /; extensions = ASC, CSV, Tab, TXT; "B.OLE DB I.STANDARD:" provider = microsoft.jet.Oledb.4.0; data source = c: / txtfilesfolder /; extended profment = "" text; hdr = yes; fmt = Delimited "" "" "HDR = YES;" INDICES That The First Row Contains ColumnNames, Not Data.

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

New Post(0)