Database Connection 2

Source: Internet
Author: User
Before the vegetable patch has written a database connection posts, the view of naïve, friends did not see suspicion, little brother but ashamed of the tight ... Modified and modified is, today, my little sister thought of learning database connection, simply another write a comprehensive introduction of this piece, I hope to be a beginner's friend to help ... :)
There are many different types of data on the web, such as text files, excel,access,sqlserver,active dircetory, and so on, so Microsoft has set up a set of database components to act as interfaces between different data types, that is, universal Database access Universal Data access UDA, the main OLE DB and ODBC methods used in ASP are quite a set of database interfaces (APIs) so that program designers can use the same set of program interfaces to develop or Access databases when writing database applications. The main difference is that the former has more data processing capabilities than the database system, and Microsoft claims that the former is more efficient than the latter.
Oh, nonsense said so much, following the article to write OLE DB to connect access and SQL Server database:
<% ' ==============================================
' OLE DB way to connect to an Access database:
Set Conn=server.createobject ("Adodb.connection")
Conn.Open "provider=microsoft.jet.oledb.4.0;datasourse=" &server.mappath ("")
'================================================
' OLE DB way to connect to the SQL Server database:
Set Conn=server.createobject ("Adodb.connection")
Conn.Open "provder=sqloledb.1;datasourse= computer name"; userid=sa;password=;initial catalog= database Name "
' ==============================================%>
The above code is directly available, in fact, the database connection is dead format, directly apply on it, the novice friends do not have to see this is very mysterious, reading or use in the forum to ask questions ... Good luck to all of you! :)

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.