1. The first connection string connecting to SQL SERVER:
For the database Authentication Mode "SQL SERVER and windows,
The connection string is:
CString strConn;
StrConn = "Provider = SQLOLEDB.1 ;\
Persist Security Info = true ;\
User ID = sa ;\
Password = 123456 ;\
Initial Catalog = tempdb ;\
Data Source = 127.0.0.1 "
// JDBC-ODBC Bridging ModeClass. forname ("Sun. JDBC. ODBC. jdbcodbcdriver ");Drivermanager. getconnection ("JDBC: ODBC: Test", user, PWD); // test indicates the name of the configured ODBC data source.You can use// SQL2000 connection method use MSSQLServer. jar package JDBC
Tags: des style color using OS io strong forOracle XEStandard connectionOracle XE (or "Oracle Database 10g Express Edition") is a simple and free release.
The following are the syntax formats: driver=(Oracle in xeclient); dbq=111.21.31.99:1521/xe; uid=MyUserName; pwd=mypassword;
OdbcNew version Connection mode
The following are the syntax formats: driver={Microsoft
One, MySQL connector/odbc 2.50 (MyODBC 2.50) connection mode1, local database connection Driver={mysql}; Server=localhost;option=16834;database=mydatabase;2, Remote data connection Driver={mysql}; server=myserveraddress;option=131072; stmt=;D atabase=mydatabase; User=myusername; Password=mypassword;3. Special TCP/IP Po
Inadvertently msgbox ADO joined the string to join the access connectionstring. So many choices were found. One by one analysis.
Standard Practices for connecting to access through ado
There are two ways to connect ADO data objects to a database: ODBC and ole db.
(1) Using OLE DB**************************************** ***************** ** Ole db provider for Microsoft Jet*********************************
Author: water and smoke
The configuration of the data source connection string is a great learning. Here I can only talk about how to connect to it. I don't understand performance security and so on.
String connection modes of various data sources can be easily found at http://www.connectionstrings.com.
The
=microsoft.ace.oledb.12.0;data source=access file path; extended Properties=excel 12.0"Note: When referencing a worksheet in code, the table name should be expressed as "[sheet name $]", and when the field is reserved for the database, the field name is added [] to differentiate, such as when a SELECT statement is defined: string connstr= "select * FROM [login$] where Username= ' abc ' and [password]= ' abc123 ' ";If you use numbers as text type data
"; Public Static stringTextprovider ="microsoft.jet.oledb.4.0"; Public Static stringOracleprovider ="Msdaora"; Public Static stringMysqlprovider ="Mysqlprov"; Public Static stringIbmdb2provider ="Db2oledb"; Public Static stringSibprovider ="Sibprovider"; Public Static stringAdaptiveserveranywhereprovider ="Asaprov"; Public Static stringAdaptiveserverenterpriseprovider ="Sybase ASE OLE DB Provider"; Public Static stringVisualfoxproprovider ="Vfpoledb"; } Public structDbdriver { Public
1. SQL Server
1> ODBC
L Standard Security: "Driver={sql Server};" Server=aron1;database=pubs; Uid=sa; PWD=ASDASD; "
L Trusted Connection: "Driver={sql Server};" Server=aron1;database=pubs; Trusted_connection=yes; "
L Prompt for username and password:
Oconn.properties ("Prompt") = adPromptAlways
oConn.Open "Driver={sql Server}; Server=aron1;database=pubs; "
2> OLE DB, OleDbConnection (. NET)
L Standard Secur
Tags: http io ar os sp for on art logTransferred from: http://stackoverflow.com/questions/3077412/ What-is-the-difference-between-trusted-connection-and-integrated-security-in-a-c-----------------------------------------------In. Net, there are a class called SqlConnectionStringBuilder that's very useful for dealing with SQL Server Conne ction strings using Type-safe properties to build up parts of the string
result = string. empty; DataConnectionDialog dialog = new DataConnectionDialog (); dialog. dataSources. clear (); // Add a data source list. You can add at least one dialog to the window. dataSources. add (DataSource. accessDataSource); // Access dialog. dataSources. add (DataSource. sqlDataSource); // SQL Server dialog. dataSources. add (DataSource. oracleDataSource); // Oracle dialog. dataSources. add (DataSource. odbcDataSource); //
I have added my favorite database string connection programs, including mysql, mssql, and access. You can also send other programs.
MSSQL connection string
(1) OLEDBWindows Authentication
The Code is as follows:
Copy code
Quot; Provider = SQLOLEDB; Data Source = PEK7-6TKX23XSQLEXPRESS; Initial
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.