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
OLEDB 接続で Access パスワード付きテーブルを開く方法
2016/9/1 (木)