VB6 Connect to MS-Access with Password

Dim db As New ADODB.Connection
Dim rec As New ADODB.Recordset
Dim recCount As Integer
db.ConnectionString = “Provider=MSDASQL.1;Persist Security Info=False;” & _
                        “Data Source=MS Access Database;” & _
                        “Initial Catalog=” & App.Path & “\dbstudent.mdb; Password=12345
db.Open
 
rec.Open “SELECT * FROM tblStudent ORDER BY [name]”, db, 3, 2
   
recCount = rec.RecordCount

……………………………………….

http://www.krookroo.com/programming-languages/ms-visual-basic-6/86-it-vb6-6.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: