|
Private Sub Command0_Click()
Dim xtpf, cxph, fs, d, v As String
Dim str4 As String
xtpf = CurrentProject.Path'当前路径
cxph = Left(xtpf, 3)
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(cxph)))
v = Hex(d.SerialNumber)
Dim RetVal
str4 = """"
Dim strMDB As String
Shell str4 & SysCmd(acSysCmdAccessDir) & "msaccess.exe" & str4 & " " & str4 & xtpf & "\sjch.mdb" & "", 2
End Sub
以上的代码可以打开ACCESS,但在有些电脑使用就打不开了,可能是SysCmd(acSysCmdAccessDir) 找不到msaccess.exe文件,如果用绝对路径就可以.但如果OFFICE安装在别的盘用绝对路径就不行了,请问有其它方法代替SysCmd(acSysCmdAccessDir) 吗?
[ 本帖最后由 好学 于 2007-11-19 11:26 编辑 ] |
|