TempVars的,并获得2003 [英] Tempvars and access 2003

查看:346
本文介绍了TempVars的,并获得2003的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

予具有用于在混合2003,2007环境的数据库。我有一个使用2007年的新TempVars的功能,一些小的功能。如果它是一个用户2003,它不是为他们没有这些功能的问题。

I have a database that is used in a mixed 2003, 2007 environment. I have some minor functionality that uses 2007's new TempVars feature. If it is a 2003 user, it isn't a problem for them to not have those features.

我怎样写我的code,这样它会编译并运行在Access 2003中我曾尝试上的错误继续下一步但这并不为之工作编译时错误。

How do I write my code so that it will compile and run on Access 2003. I have tried on error resume next but this doesn't work for compile time errors.

推荐答案

如果您的应用程序将与Access 2003中使用,在我看来,你应该排除2003功能不支持。

If your application will be used with Access 2003, seems to me you should exclude features 2003 doesn't support.

不过,如果你必须有TempVars的,看到一个条件编译常数的做法是否会让它为你工作。

However, if you must have Tempvars, see whether a conditional compiler constant approach would make it work for you.

Option Compare Database
Option Explicit
#Const Aversion = "2007" 'conditional compiler constant '

Public Sub HelloWorld()
    Dim strWho As String
    strWho = "World"

    #If Aversion = "2007" Then
        '* your 2007 feature code here *'
        strWho = UCase(strWho)
    #End If
    'Aversion 2003 -> Hello World '
    'Aversion 2007 -> Hello WORLD '
    Debug.Print "Hello " & strWho
End Sub

请访问帮助了解有关的 #Const 的更多信息和#如果的。

我没有测试过这一点,但我认为它可以工作。您可能需要你的数据库的两个副本:YourDb2003.mdb;和YourDb2007.mdb。在YourDb2003.mdb在YourDb2007.mdb使用2003作为编译器常量,而2007。

I haven't tested this, but I think it could work. You might need two copies of your database: YourDb2003.mdb; and YourDb2007.mdb. In YourDb2003.mdb use "2003" as the compiler constant, and "2007" in YourDb2007.mdb.

这篇关于TempVars的,并获得2003的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆