VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Connect to a database

by rajesh K (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 14th December 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Connect to a database

Rate Connect to a database



strCNString = "Data Source=" & App.Path & "\dbname.mdb"
cn.Provider = "Microsoft Jet 4.0 OLE DB Provider"
cn.ConnectionString = strCNString
cn.Properties("Jet OLEDB:Database Password") = ""
cn.Open

If cn.State = adStateConnecting Then MsgBox "Connecting Data Source...."
If cn.State = adStateOpen Then MsgBox "Connection Successful."
'cn.Close
End Sub

Download this snippet    Add to My Saved Code

Connect to a database Comments

No comments have been posted about Connect to a database. Why not be the first to post a comment about Connect to a database.

Post your comment

Subject:
Message:
0/1000 characters