OLEDB 接続で Access パスワード付きテーブルを開く方法

投稿日:2016/9/1 (木) 更新日:

Dim pWorkspaceFactory As IWorkspaceFactory
Set pWorkspaceFactory = New OLEDBWorkspaceFactory
 
Dim pPropertySet As IPropertySet
Set pPropertySet = New PropertySet
 
Dim strPassword As String
strPassword = "test"
 
Dim sConString As String
sConString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
            "Data Source=E:\db1.mdb;" & _
            "Jet OLEDB:Database Password=" & strPassword " &";"
 
pPropertySet.SetProperty "CONNECTSTRING", sConString
 
Dim pWorkspace As IWorkspace
Set pWorkspace = pWorkspaceFactory.Open(pPropertySet, 0)
 
 
 
Dim sConString As String
Dim JETAdocon As ADODB.Connection
Set JETAdocon = New ADODB.Connection
 
sConString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
            "Data Source=E:\db1.mdb;" & _
            "Jet OLEDB:Database Password=" & strPassword " &";"
 
 
JETAdocon.Open sConString

関連記事

-プログラミング, ArcGIS
-, ,

Copyright© WINGFIELD since1981 , 2018 All Rights Reserved.