Super multi-complete database connection field!

xiaoxiao2021-03-06  91

?? Sql server

? ODBC

? Standard Security:

"Driver = {SQL Server}; server = aron1; data = pubs; uid = sa; pwd = asdasd;"

Trusted Connection:

"Driver = {SQL Server}; server = aron1; database = pubs; trusted_connection = yes;"

PROMPT for username and password:

Oconn.properties ("prompt") = adpromptalways

Oconn.open "driver = {SQL Server}; server = aron1; database = public;"

? OLE DB, OLEDBCONNECTION (.NET)

? Standard Security:

"Provider = sqloledb; data source = aron1; initial catalog = pubs; user ID = sa; password = asdasd;"

Trusted Connection:

"Provider = sqloledb; data source = aron1; initial catalog = pubs; integrated security = SSPI;

(Use Servername / InstanceName As Data Source To Use An Specifik Sqlserver Instance, "ONLY SQLSERVER2000)

PROMPT for username and password:

Oconn.Provider = "sqloledb"

Oconn.properties ("prompt") = adpromptalways

Oconn.open "Data Source = aron1; initial catalog = public;"

• Connect Via An IP Address:

"Provider = SQLOLEDB; DATA SOURCE = 190.190.200.100, 1433; network library = dbmssocn; initial catalog = pubs; user ID = sa; password = asdasd;"

(DBMSSOCN = TCP / IP INSTEAD OF NAMED PIPES, AT THE End of The Data Source Is The Port To Use (1433 Is The Default))

? SqlConnection (.NET)

? 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"

??? (Booth Connection Strings Products the Same Result)

Trusted Connection:

"Data Source = aron1; initial catalog = pubs; integrated security = sspi;" ??? -? Or? -

"Server = aron1; database = pubs; trusted_connection = true;"

??? (Booth Connection Strings Products the Same Result)

(Use Servername / InstanceName As Data Source To Use An Specifik Sqlserver Instance, "ONLY SQLSERVER2000)

• Connect Via An IP Address:

"Data Source = 190.190.200.100, 1433; network library = dbmsoCN; Initial catalog = pubs; user ID = sa; password = asdasd;"

(DBMSSOCN = TCP / IP INSTEAD OF NAMED PIPES, AT THE End of The Data Source Is The Port To Use (1433 Is The Default))

Declare the SqlConnection:

C #: use system.data.sqlclient; sqlconnection osqlconn = new sqlconnection (); osqlconn.connectionstring = "my connectionstring"; osqlconn ();

VB.Net:imports system.data.sqlclientdim osqlconn as sqlconnection = new sqlconnection () osqlconn.connectionstring = "my connectionstring" osqlconn.open ()

Data Shape

? Ms data shape "provoder = msdatashape; data provider = sqloledb; data source = aron1; initial catalog = pubs; user ID = sa; password = asdasd;"

Want to Learn Data Shaping? Check Out 4Guyffromrolla's Great Article About Data Shaping >>

? Read more

? How to define Wich Network Protocol To Use

EXAMPLE:

"Provider = SQLOLEDB; DATA SOURCE = 190.190.200.100, 1433;

Network library = dbmssocn; initial catalog = pubs; user ID = sa; password = asdasd; "

Namenetwork librarydbnmpntwwin32 named pipesdbmsoCnwin32 Winsock TCP / IPDBMSSPXNWIN32 SPX / IPXDBMSRPCNWIN32 Banyan VINESDBMSRPCNWIN32 MULTI-Protocol (Windows RPC)

Important note! When connecting through the SQLOLEDB provider use the syntax Network Library = dbmssocnand when connecting through MSDASQL provider use the syntax Network = dbmssocn? All SqlConnection connectionstring properties

This Table Shows All Connectionstring Properties for the ado.net sqlConnection Object. Most of the Properties Area ALSO Used in ado. All Properties and descriptions is from msdn.

NameDefaultDescriptionApplication Name? The name of the application, or '.Net SqlClient Data Provider' if no application name is provided.AttachDBFilename-or-extended? Properties-or-Initial File Name? The name of the primary file, including the full path name , of an attachable database. The database name must be specified with the keyword 'database'.Connect Timeout-or-Connection Timeout15The length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error. Connection Lifetime0When a connection is returned to the pool, its creation time is compared with the current time, and the connection is destroyed if that time span (in seconds) exceeds the value specified by connection lifetime. Useful in clustered configurations to force load balancing between A Running Server and a Server Just BROUGHT ON-line.connection reset'true'determines WHENER THE DATABASE Connection Is Reset When Removed from the pool. setting to 'false' Avoids MAK ing an additional server round-trip when obtaining a connection, but the programmer must be aware that the connection state is not being reset.Current Language? The SQL Server Language record name.Data Source-or-Server-or-Address-or- addr-or-Network address? The name or network address of the instance of SQL Server to which to connect.Enlist'true'When true, the pooler automatically enlists the connection in the creation thread's current transaction context.Initial Catalog-or-Database • name of the database.integrated security-or-trusted_connection'false'whet connection or not. Recognized Values ​​Are 'True', 'False', and 'SSPI'

, Which is equivalent to 'true'.Max Pool Size100The maximum number of connections allowed in the pool.Min Pool Size0The minimum number of connections allowed in the pool.Network Library-or-Net'dbmssocn'The network library used to establish a connection to an instance of SQL Server. Supported values ​​include dbnmpntw (Named Pipes), dbmsrpcn (Multiprotocol), dbmsadsn (Apple Talk), dbmsgnet (VIA), dbmsipcn (Shared Memory) and dbmsspxn (IPX / SPX), and dbmssocn (TCP / IP). The Corresponding Network DLL Must Be Installed on The System To Which You Connect. If You Use A Local Server (for Example, "), Shared Memory IS Used .Packet Size8192Size in bytes of the network packets used to communicate with an instance of SQL Server.Password-or-Pwd? The password for the SQL Server account logging on.Persist Security Info'false'When set to 'false', security- Sensitive Information, Such As The Password, IS NOT RETURNED AS Part of The Connection If The Connection is open or has ever been in an open state. Resetting the connection string resets all connection string values ​​including the password.Pooling'true'When true, the SQLConnection object is drawn from the appropriate pool, or if necessary, is created and added to .

Note Use; to separate each property.If a name occurs more than once, the value from the last one in the connectionstring will be used.If you are building your connectionstring in your app using values ​​from user input fields, make sure the user can 'T Change the Connectionstring by Inserting An Additional Property with Another Value within the user value.?access

? ODBC

? Standard Security:

"Driver = {Microsoft Access Driver (* .mdb)}; dbq = c: /mydatabase.mdb; uid = admin; pwd =;"

Workgroup:

"Driver = {Microsoft Access Driver (* .mdb)}; dbq = c: /mydatabase.mdb; systemdb = c: /mydatabase.mdw;"

? EXCLUSIVE:

"Driver = {Microsoft Access Driver (* .mdb)}; dbq = c: /mydatabase.mdb; Exclusive = 1; UID = admin; pwd ="

? OLE DB, OLEDBCONNECTION (.NET)

? Standard Security:

"Provider = microsoft.jet.Oledb.4.0; data source = / somepath / mydb.mdb; user ID = admin; password =;"

? Workgroup (System Database):

"Provider = microsoft.jet.Oledb.4.0; data source = / somepath / mydb.mdb; Jet OLEDB: System Database = system.mdw;"

? With pasword:

"Provider = microsoft.jet.Oledb.4.0; data source = / somepath / mydb.mdb; jet oledb: Database password = mydbpassword;"

? Oracle

? ODBC

New version:

"Driver = {microsoft odbc for oracle}; server = oracleserver.world; uid = username; pwd = asdasd;"

? Old Version:

"Driver = {microsoft odbc driver for oracle}; connectionString = oracleserver.world; uid = myusername; pwd = mypassword;"

? OLE DB, OLEDBCONNECTION (.NET)

? Standard Security:

"Provider = msdaora; data source = myoracledb; user id = username; password = asdasd;"

This One's from Microsoft, The Following Are from Oracle, THE FLLOWING ARE

• Standard security: "provider = oraoledb.racle; data source = myoracledb; user id = username; password = asdasd;"

Trusted Connection:

"Provider = oraoledb.racle; data source = myoracledb; osauthent = 1;"

? OracleConnection (.NET)

? Standard:

"Data Source = Oracle8i; Integrated Security = YES;"

This One Works Only with Oracle 8i Release 3 or Later

? Specifying username and password:

"Data Source = Oracle8i; user ID = username; password = passwd; integrated security = no;"

This One Works Only with Oracle 8i Release 3 or Later

Declare the OracleConnection:

C #: use system.data.racleClient; OracleConnection OracleConn = New OracleConnection (); oracleconn.connectionstring = "my connectionstring"; oracleconn.open ();

VB.NET: IIMPORTS System.Data.OracleClientDim Oracleconn As OracleConnection = New OracleConnection () Oracleconn.Connectionstring = "My Connectionstring" oracleconn.open ()

? Core Labs ORADIRECT (.NET)

? Standard: "User ID = Scott; Password = Tiger; host = ora; pooling = true; min pool size = 0; max pool size = 100; connection lifetime = 0"

Read more at

Core lab and the product page.

Data Shape

MS Data Shape: "Provider = MSDataShape.1; Persist Security Info = False; Data Provider = Msdara; Data Source = ORAC; User ID = UserName; Password = MyPW"

Want to Learn Data Shaping? Check Out 4Guyffromrolla's Great Article About Data Shaping >>

? MySQL

? ODBC

? ODBC 2.50 local Database:

"Driver = {mysql}; server = localhost; option = 16834; Database = mydatabase;"

? ODBC 2.50 Remote Database:

"Driver = {mysql}; server = data.domain.com; port = 3306; option = 131072; STMT =; Database = my-database; uid = username; pwd = password;"? Odbc 3.51 local data:

"Driver = {mysql odbc 3.51 driver}; server = localhost; data = mydatabase; user = myusername; password = mypassword; option = 3;"

? ODBC 3.51 REMOTE DATABASE:

"Driver = {mysql odbc 3.51 driver}; server = data.domain.com; port = 3306; database = mydatabase; user = myusername; password = mypassword; option = 3;"

? OLE DB, OLEDBCONNECTION (.NET)

? Standard:

"Provider = mysqlprov; data source = mydb; user id = username; password = asdasd;"

? MySQLConnection (.NET)

? Einfodesigns.dbProvider:

"Data Source = Server; Database = MYDB; User ID = Username; Password = PWD; Command logging = false"

This One is used with einfodesigns dbprovider, an add-on to .net

Declare The MySqlConnection:

C #: use einfodesigns.dbprovider.mysqlclient; mysqlconnection omysqlconn = new mysqlconnection (); omysqlconn.connectionstring = "my connectionstring"; omysqlconn.open ();

VB.Net:imports einfodesigns.dbprovider.mysqlclientdim omysqlconn as mysqlconnection = new mysqlconnection () omysqlconn.connectionstring = "my connectionString" omysqlconn.open ()

? SevenObjects mysqlclient (.NET)

? Standard:

"Host = server; username = myusername; password = mypassword; database = mydb;"

This is a freeware ado.net data provider from SevenObjects

? Core Labs mysqldirect (.NET)

? Standard:

"User ID = root; password = pwd; host = localhost; port = 3306; dataBase = test; Direct = true; protocol = tcp; compress = false; pooling = true; min pool size = 0; max pool size = 100; Connection Lifetime = 0 "Read more at

Core lab and the product page.

Interbase

? Odbc, easysoft

? Local Computer:

"Driver = {easysoft IB6 odbc}; server = localhost; database = localhost: c: /mydatabase.gdb; uid = username; pwd = password

Remote Computer:

"Driver = {easysoft IB6 odbc}; server = computername; database = computername: c: /mydatabase.gdb; uid = username; pwd = password

Read more About this Driver: EasySoft ODBC-InterBase Driver >>

? ODBC, INTERSOLV

? Local Computer:

"Driver = {INTERSOLV Interbase ODBC Driver (* .GDB)}; server = localhost; database = localhost: c: /mydatabase.gdb; uid = username; pwd = password

Remote Computer:

"Driver = {INTERSOLV InterBase ODBC Driver (* .GDB)}; server = computername; Database = computename: c: /mydatabase.gdb; uid = username; pwd = password

This Driver Are Provided by DataDirect Technology >> (Formerly Intersolv)

? OLE DB, SIBPROVIDER

? Standard:

"provider = sibprovider; location = localhost:; data source = c: /Databases/gdbs/mygdb.gdb; user ID = sysdba; password = masterkey

? Specifying Character Set:

"provider = sibprovider; location = localhost:; data source = c: /Databases/gdbs/mygdb.gdb; user ID = sysdba; password = masterkey; character set = iso8859_1

? Specifying role:

"provider = sibprovider; location = localhost:; data source = c: /databases/gdbs/mygdb.gdb; user ID = sysdba; password = masterkey; role = digitadores

Read more About Sibprovider >> Read More About Connecting to Interbase In this borland developer network article http://community.borland.com/Article/0,1410,27152,00.html

IBM DB2

? OLE DB, OLEDBCONNECTION (.NET) from MS

? TCP / IP:

"Provider = DB2OLEDB; Network Transport Library = TCPIP; Network Address = XXX.XXX.XXX.XXX; Initial Catalog = MyCtlg; Package Collection = MyPkgCol; Default Schema = Schema; User ID = MyUser; Password = MyPW"

? 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"

? IBM's OLE DB Provider (Shipped with IBM DB2 UDB V7 or Above)

? TCP / IP:

Provider = IBMDADB2; Database = Sample; hostname = db2host; protocol = tcpip; port = 50000; uid = myusername; pwd = mypwd;

? ODBC

? Standard:

"driver = {IBM DB2 ODBC Driver}; Database = mydbname; hostname = myservername; port = myportnum; protocol = tcpip; uid = myusername; pwd = mypwd"

? Sybase

? ODBC

? Standard Sybase System 12 (or 12.5) Enterprise Open Client:

"Driver = {Sybase ASE ODBC Driver}; SRVR = aron1; uid = username; pwd = password"

? Standard Sybase System 11:

"Driver = {Sybase System 11}; SRVR = aron1; uid = username; pwd = password;"

Do you know a Userguide for Sybase System 11, 12, 12.5? E-mail the url to connectionstrings.com now !! >>

INTERSOLV 3.10:

"Driver = {INTERSOLV 3.10 32-bit Sybase}; SRVR = aron1; uid = username; pwd = password;"

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 =" "" "Note! The Two double quota following the DSN parameter at the end are escaped quotas (VB syntax), you may have to change this to your language specific escape syntax. The empty DSN parameter is indeed critical as not including it will result in error 7778.

Read more in the Sybase SQL Anywhere User Guide >>

? OLE DB

Adaptive Server Anywhere (ASA):

"Provider = asaprov; data source = myasa"

Read more in the asa user guide >>

Adaptive Server Enterprise (ASE) with Data Source .ids File:

"Provider = Sybase ASE OLE DB Provider; Data Source = Myase"

Note That You Must Create A Data Source .ids File Using The Sybase Data Administrator. The Sybase Files Resemble ODBC DSNS.

Adaptive Server Enterprise (ASE):

"Provider = sybase.AseoledbProvider; SRVR = MyaseServer, 5000; Catalog = MyDBName; user ID = username; password = password"

??? - Some Reports On Problem Using The Above One, Try The Following as an alternative -

"Provider = sybase.AseoledbProvider; Server name = myaseserver, 5000; initial catalog = mydbname; user ID = username; password = password"

This One Works Only from Open Client 12.5 WHERE The Server Port Number Feature Works, Ambig Llowing Fully Qualified Connection Strings To Be Used without Defining Ny .ids Data Source Files.

? Aconnection (.NET)

? Standard:

"Data Source = 'MyaseServer'; port = 5000; database = 'mydbname'; uid = 'username'; pwd = 'password';"

Declare the aseconnection:

C #: using Sybase.Data.AseClient; AseConnection oCon = new AseConnection (); oCon.ConnectionString = "my connection string"; oCon.Open (); VB.NET:Imports System.Data.AseClientDim oCon As AseConnection = New AseConnection ( ) Ocon.Connectionstring = "my connection string" Ocon.Open ()

Informix

? ODBC

INFORMIX 3.30:

"DSN = ''; driver = {informix 3.30 32 bit}; host = hostname; service = myserver; service = service-name; protocol = ilSoctcp; database = mydb; uid = username; pwd = mypwd

INFORMIX-CLI 2.5:

"Driver = {INFORMIX-CLI 2.5 (32 bit)}; server = myserver; database = mydb; uid = username; pwd = mypwd

? OLE DB

? IBM Informix Ole DB Provider:

"Provider = ifxoledbc.2; password = mypw; user ID = myuser; data source = dbname @ ServerName; persist security info = true"

? Ingres

? ODBC

DSN-Less

"Provider = MSDASQL.1; DRIVER = Ingres; SRVR = xxxxx; DB = xxxxx; Persist Security Info = False; uid = xxxx; pwd = xxxxx; SELECTLOOPS = N; Extended Properties =" "" SERVER = xxxxx; DATABASE = xxxxx Servertype = INGRES ""

? Mimer SQL

? ODBC

? Standard Security:

"Driver = {mimer}; database = mydb; uid = myuser; pwd = mypw;"

PROMPT for username and password:

"Driver = {mimer}; Database = mydb;"

? PostgreSQL

? Core Labs PostgreSqldirect (.NET)

? Standard:

"User ID = root; password = pwd; host = localhost; port = 5432; dataBase = testdb; pooling = true; min pool size = 0; max pool size = 100; connection lifetime = 0"

Read more at

Core lab and the product page.

DSN

? ODBC

? DSN:

"DSN = MYDSN; UID = Username; PWD =;"

? File DSN:

"FileDSN = c: /mydata.dsn; uid = username; pwd =;"? Excel

? ODBC

? Standard:

"Driver = {Microsoft Excel Driver (* .xls)}; driverid = 790; dbq = c: /myexcel.xls; defaultdir = c: / mypath;"

? OLE DB

? Standard:

"Provider = microsoft.jet.Oledb.4.0; data source = c: /myexcel.xls; extended proties =" "Excel 8.0; HDR = YES; IMEX = 1" ""

"HDR = yes;" INDICES That The First Row Contains ColumnNames, Not Data

"IMEX = 1;" TELLS The Driver to Always Read "Intermixed" Data Columns As Text

TIP! SQL SYNTAX: "SELECT *" "- I. Worksheet Name Followed by a" $ "and wrapped in" [""] "brackets.

? Text

? ODBC

? Standard:

"Driver = {Microsoft text driver (* .txt; * .csv)}; dbq = c: / txtFilesfolder /; extensions = ASC, CSV, Tab, TXT;

? OLE DB

? Standard:

"Provider = microsoft.jet.Oledb.4.0; data source = c: / txtfilesfolder /; extended proties =" "text; hdr = yes; fmt = delimited" ""

"HDR = yes;" INDICES That The First Row Contains ColumnNames, Not Data

? DBF / FoxPro

? ODBC

? Standard:

"Driver = {Microsoft DBase Driver (* .dbf)}; driverid = 277; dbq = c: / mydbpath;"

? OLE DB, OLEDBCONNECTION (.NET)

? Standard:

"Provider = microsoft.jet.Oledb.4.0; data source = c: / folder; extended Properties = dbase iv; user ID = admin; password ="

? AS / 400

? OLE DB

? IBM Client Access Ole DB Provider:

"Provider = IBMDA400; DATA SOURCE = my_system_name; uid = myusername; pwd = mypwd"

Where my_system_name is the name given to the system connection in Operationsnavigator

? ODBC

IBM Client Access ODBC Driver:

"Driver = {Client Access ODBC Driver (32-bit)}; system = my_system_name; uid = myusername; pwd = mypwd"? Visual FoxPro

? OLE DB, OLEDBCONNECTION (.NET)

Database Container (.dbc):

"Provider = vfpoledb.1; data source = c: /mydbfolder/mydbcontainer.dbc; collating sequence = machine"

Free Table Directory:

"Provider = vfpoledb.1; data source = c: / mydataDirectory /; collating sequence = general"

? Force the provider to use an odbc dsn:

"" Provider = vfpoledb.1; dsn = mydsn ""

Read more (Microsoft MSDN >>

? ODBC

Database Container (.dbc):

"Driver = {Microsoft Visual FoxPro Driver}; SourceType = DBC; SourceDb = C: /MYVFPDB.DBC; Exclusive = NO; NULL = NO; Collate = Machine; BackgroundFetch = NO; DeleteD = no"

Free Table Directory:

"Driver = {Microsoft Visual FoxPro Driver}; SourceType = DBF; SourceDb = C: / MyVfpdbFolder; Exclusive = NO; Collate = Machine; NULL = NO; Deleted = NO; BackgroundFetch = no;

"Collate = Machine" is the default setting, for other settings check the list of supported collating sequences >>

Microsoft Visual FoxPro Site: http://msdn.microsoft.com/vfoxpro

Pervasive

? ODBC

? Standard:

"Driver = {Pervasive ODBC Client Interface}; servername = srvname; dbq = @ dbname"

Pervasive ODBC INFO >>

? OLE DB

? Standard:

"Provider = pervasiveoledb; data source = c: / path"

Pervasive OLE DB INFO >>

? Udl

? Udl

? UDL:

"File name = c: /mydataLink.ud;"

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

New Post(0)