SQL logon that we learned together in those days

Source: Internet
Author: User
Tags dsn

I got this system (student management system). The first thing is to create a database, open the database --- file -- open -- Student

 

Load ---- execute it. The database is created! Self-built tables will be studied in the future ......

Method 1 for database data connection --------- filedsn

Filedsn is used for data source connection. You have configured it yourself,

Management Tool ---------- data source (ODBC)

 

Second: PassSQL oledb connection method

Public Function ConnectString() As StringConnectString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=student;Data Source=lishehe-pc"End Function

Third: the relationship between oledb, ADO, and ADOX:
 ODBC:Previous Database Communication Standards
 Oledb:Under the trend of all objectiveness, Ms intends to use it to replace ODBC.
 OledbThere are two types: Direct oledb and ODBC-oriented oledb. The latter architecture is on ODBC.
 The characteristics of oledb can also be used for databases without their own oledb providers.
 ADO:It is actually an application-level interface, which uses oledb to communicate with databases.
 ADOX:Extends the Security and maintainability of ADO (for example, creating a database.

2. Use ODBC to connect to the database:
ODBC provides three kinds of DSN, the difference is very simple: User DSN can only be used for this user. The difference between the system DSN and the file DSN is that the storage location of the connection information is different: the system DSN is stored in the ODBC storage area, and the file DSN is placed in a text file.
 Their creation methods will not be mentioned.
 When using them in ASP, the statement is as follows:
 

A. SQL Server: Use system DSN: connstr = "DSN = dsnname; uid = xx; Pwd = xxx; database = dbname" Use File DSN: connstr = "filedsn = xx; uid = xx; Pwd = xxx; database = dbname "you can also use a connection string (to avoid creating a DSN): connstr =" driver = {SQL Server}; server = servername; uid = xx; Pwd = xxx "B. access: Use system DSN: connstr = "DSN = dsnname" (or: connstr = "DSN = dsnname; uid = xx; Pwd = xxx") with file DSN: connstr = "filedsn = xx" you can also use a connection string (so that you do not need to create a DSN): connstr = "driver = {Microsoft Access driver}; DBQ = D: abcabc. mdb"

3. Use oledb to connect to the database:
 

 A.sql   server:          connstr= "PROVIDER=SQLOLEDB;                  DATA   SOURCE=servername;UID=xx;PWD=xxx;DATABASE=dbname "        B.access:          connstr= "PROVICER=MICROSOFT.JET.OLEDB.4.0;                  DATA   SOURCE=c:abcabc.mdb " 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.