natt_han’s Weblog

set database password to ms access programatically

Posted by: dragonquestx on: ธันวาคม 18, 2008

Dim oAccess As Microsoft.Office.Interop.Access.Application = New Microsoft.Office.Interop.Access.Application

                Dim sDBPath As String = ‘database path’

                oAccess.OpenCurrentDatabase(sDBPath, True, “password”)

                Dim accessDB As Database = oAccess.CurrentDb()

                accessDB.Close()

                accessDB = Nothing

                oAccess.CloseCurrentDatabase()

 

connection string 
 Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\mydatabase.mdb;Jet OLEDB:Database Password=MyDbPassword;

ป้ายกำกับ: , ,

ใส่ความเห็น


  • ไม่มี
  • Mr WordPress: Hi, this is a comment.To delete a comment, just log in, and view the posts' comments, there you will have the option to edit or delete them.

หมวดหมู่