Monday, December 17, 2007

How to open a database source

How to open a database source

S T E P - 1

- In the Connection object, it provides the Open method to open a database:

oConn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("db1.mdb")

S T E P - 2

- If this connection required user name and user password:

oConn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("db1.mdb"), User, Password

S T E P - 3

- After using the connection, we will need to close it!

oConn.Close

Set oConn = Nothing


No comments: