architecture re-design, hard-coded connection strings, etc, it is worth using. Item2 set the connection string Option
The connection string contains the web application.ProgramAll information required to connect to the database. Dreamweaver inserts this
ODBC is the oldest, but it is still in use today. Occasionally used. DAO and RDO are old interfaces. OLE db new, complex Microsoft out of ADO. VC + + ADO is the mainstream: both MySQL and Oracle have dedicated interfaces. The ADO underlying is an OLE DB implementation. ADO is a COM component.ADO Private Folders:To open the StdAfx.h header file with MsADO15.dll:Import the library:Initialize ADO when initializing an instance: Here are the COM programmin
Connection Database | String One, the principle of accessing the database
In ASP, the objects used to access the database are collectively called ADO objects (Active Data Objects), which contains three objects: Connection, Recordset, and command, where Connection is responsible for opening or connecting to the databas
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
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 "
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); //
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
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
(NULL);_connectionptr Pconn (__uuidof (Connection));_RecordsetPtr pRst (__uuidof (Recordset));_bstr_t strconnect= "uid=;p wd=;D river={microsoft Access DRIVER (*.mdb)};D bq=c:\\mac.mdb;";
Pay special attention to the connection string here or use the following connection string
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
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.