Use ASP to access various common type database (5)

Source: Internet
Author: User
Tags mdb database table name
Iii. List of procedures

' The following programs are written in VBScript

2 Create a Recordset object with a password MDB database, which is built like a Recordset object with an MDB database without a password, but one more password parameter, that is, the password information must be given when connecting to the database.

Function createsecuredmdbrecordset (database file name, data table name or SELECT statement, password)

Dim Conn,provider,dbpath

' Create a Connection object
Set conn = Server.CreateObject ("ADODB. Connection ")
Provider = "Provider=Microsoft.Jet.OLEDB.4.0;"
DBPath = "Data source=" & Server.MapPath ("Database file name")
' Connect to the database, note the following line with password parameters
Conn. Open Provider & dbpath& "Jet oledb:database password=" &assword
Set Createsecuredmdbrecordset = Server.CreateObject ("ADODB. Recordset ")
' Open data table, parameter two is connection object
Createsecuredmdbrecordset.open "datasheet name", Conn, 2, 2

End Function


Related Article

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.