Dim x As Object On Error Resume Next Set x = CreateObject("Access.Application") If Err.Number <> 0 Then '没有安装Access. Else '安装了,,但不知道版本,我没仔细找. End If
Dim x As Object On Error Resume Next Set x = CreateObject("Access.Application") If Err.Number <> 0 Then '没有安装Access. Else if x.Version="8" then msgbox "Access97" else if x.Version="9" msgbox "Access2000" else msgbox "Access" & x.Version end if End If
On Error Resume Next
Set x = CreateObject("Access.Application")
If Err.Number <> 0 Then
'没有安装Access.
Else
'安装了,,但不知道版本,我没仔细找.
End If
On Error Resume Next
Set x = CreateObject("Access.Application")
If Err.Number <> 0 Then
'没有安装Access.
Else
if x.Version="8" then
msgbox "Access97"
else if x.Version="9"
msgbox "Access2000"
else
msgbox "Access" & x.Version
end if
End If
HOWTO: Ensure Jet 3.5 Is Installed Correctly (Part I) (Q240377)
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q240377HOWTO: Ensure Jet 3.5 Is Installed Correctly (Part II) (Q245524)
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q245524INFO: Deploy Database Applications with the Package and Deployment Wizard (PDW) (Q213846)
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q213846另外你可以搜索
Setup1.vbp 工程内
查找 "MDAC_TYPE.EXE" 附近的代码
Dim x As Object
Set x = CreateObject("ADODB.connection")
debug.print x.version
我的机子上是2.6的,如果有多个版本,一般都显示最高的版本.
---------------
没有必要让已经有这个组件的用户浪费时间下载7M多的东西
---------------
好象2.6不支持jet 4.0 是这样吗?如果显示最高的版本,就不知道能不能支持jet 4.0我也是在别的地方看到的,不知道2.6以上如何连接Access数据库
---------------
问题不大,基本上解决了,给分给分