四種用代碼打開外部Access(MDB)的方法
方法1:
Dim AccessPath As String
Dim DbPath As String
AccessPath = SysCmd(acSysCmdAccessDir) &"MSACCESS.EXE"
DbPath = "C:\db1.mdb"
Shell AccessPath &" " & DbPath
方法2:
Dim DbPath As String
DbPath = "C:\db1.mdb"
Application.FollowHyperlink DbPath
方法3:
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" _
(ByVal hwnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Sub OpenBd()
Dim DbPath As String
DbPath = "C:\db1.mdb"
ShellExecute 0&, vbNullString, DbPath, vbNullString, vbNullString, 0&;
End Sub
方法4:
Dim DbPath As String
Dim oApp As Access.Application
DbPath = "c:\db1.mdb"
Set oApp = New Access.Application
With oApp
.Visible = True
.OpenCurrentDatabase DbPath
.DoCmd.OpenForm "MyForm"
.DoCmd.OpenReport "MyReport", acViewPreview
.Run "MyFuncion"
End With
Set oApp = Nothing
(責任編輯:admin)
- ·兩個未公開的ACCESS方法的使用技巧
- ·如何拆分復制的Access 97數(shù)據(jù)庫
- ·兩個未公開的ACCESS方法的使用技巧
- ·用Access 2000有效地組織班級管理
- ·數(shù)據(jù)在Access與Office組件間自由流動
- ·Access"智庫"培訓--高效設(shè)計 敏捷開
- ·Access查詢的基本知識(二)(Office免費
- ·Access設(shè)置宏的安全等級
- ·Access查詢的基本知識(Office免費公開
- ·四種用代碼打開外部Access(MDB)的方法
- ·access操作或事件已被禁用模式阻止的解
- ·簡述vba字符串,函數(shù),表達式等基礎(chǔ)術(shù)
- ·Access VBA 開發(fā)公開課講座
- ·Access設(shè)置信任位置
- ·Access應用程序應注意的幾個問題
- ·簡析能判斷Access版本的窗體