> 1. What settings do VC need to make when connecting to the SQL Server database?
-----------------------------------------------------
(1) initialize the com library and introduce the ADO library definition file.
(2) connect to the database using the connection object
(3) Use the established connection to execute SQL commands through the connection and command objects, or use the recordset object to obtain the result record set for query and processing.
(4) Close the connection and release the object after use.
> 2.ado, oledb, ODBC, Dao, and other database-related words respectively? What is the relationship?
-----------------------------------------------------
There are several different database connection methods.
Oledb is a database connection method based on component objects.
ADO is a simple and fast oledb connection method based on oledb.
ODBC connection methods developed by database vendors based on the public interfaces of databases developed by Microsoft.
Dao is a simpler data connection method developed by Microsoft. It was used more early.
> 3. Brief steps for connecting to the database with VC.
-----------------------------------------------------
There are some on hand. By the way, I checked it online. The following should be correct.
Http://www.yesky.com/413/1839913.shtml
The following code provides the connection mode of the VC + ADO database:
# Import "C: \ Program Files \ common files \ System \ ADO \ msadox. dll" rename_namespace ("ADOX ")
# Import "C: \ Program Files \ common files \ System \ ADO \ msado15.dll "\
Rename_namespace ("Ado") Rename ("EOF", "endoffile ")
# Pragma warning (Disable: 4146)
# Include "icrsint. H"
# Include "shlwapi. H"
# Pragma comment (Lib, "shlwapi. lib ")
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.