About creating an Access database with ADO

Source: Internet
Author: User
Tags access database access
access|ado| Create | data | Database to use an Access database on a Web site, you do not have to purchase Microsoft access. You can create a new Access database in an Active Server Page script using ODBC Data Explorer or a data Link program or programming.
ADO itself does not have a way to create a new Access database. To create a new database in Active Server Page, you must use ADOX. ADOX is included in MDAC 2.1 and its newer version, which can be downloaded from Microsoft ( http://www.microsoft.com/data). The following script creates a new Access database and opens a connection to it.
<%
dbname = "C:\myAccessDB.mdb"
Set Mycat = Server.CreateObject ("ADOX. Catalog ")
Mycat.create "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & dbname
Set Con = Server.CreateObject ("ADODB.") Connection ")
Con.open "Provider=microsoft. JET. Oledb.4.0;data source= "& dbname
%>
This script creates a ADOX Catalog object instance that creates a new Access database with the object's Create method. Then, open the connection to the new Access database with the original OLE DB provider.

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.