MS Access2000前端 - MS SQL2000后端 - dbSeeChanges [英] MS Access2000 frontend - MS SQL2000 Backend - dbSeeChanges

查看:99
本文介绍了MS Access2000前端 - MS SQL2000后端 - dbSeeChanges的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发MS Access2000中的应用程序 - 后端数据库MS SQL 2000.

当应用程序启动时,它会刷新到后端的链接,如:

I am developing an application in MS Access2000 - back-end database MS SQL 2000.
When the application starts up, it refreshes link to backend like:

展开 | 选择 | Wrap | 行号

推荐答案

嗨。虽然它是您要运行的更新,但语法CurrentDB.Update不正确。您的更新仍应使用CurrentDB.Execute([update statement])运行,就像您对INSERT语句所做的那样。


执行用于所有类型的动作查询(插入,删除,更新)。


令人费解的是没有更新Database对象的方法(CurrentDB返回指向当前正在使用的数据库对象的指针)。我无法解释为什么你收到你引用的错误消息,因为我本来期望某种语法错误,但我确信你应该使用Execute方法而不是你引用的语句中的Update一词。


-Stewart
Hi. Although it is an Update you want to run, the syntax CurrentDB.Update is not correct. Your Update should still be run using CurrentDB.Execute ([update statement]) just as you did for the INSERT statement.

Execute is used for all types of action queries (insert, delete, update).

What is puzzling is that there is no Update method of the Database object (CurrentDB returns a pointer to the current database object that is in use). I can''t explain why you are getting the error messages you quote, as I would have expected a syntax error of some kind, but I am certain that you should be using the Execute method and not the word Update in the statement you quote.

-Stewart



嗨。虽然它是您要运行的更新,但语法CurrentDB.Update不正确。您的更新仍应使用CurrentDB.Execute([update statement])运行,就像您对INSERT语句所做的那样。


执行用于所有类型的动作查询(插入,删除,更新)。


令人费解的是没有更新Database对象的方法(CurrentDB返回指向当前正在使用的数据库对象的指针)。我无法解释为什么你收到你引用的错误消息,因为我本来期望某种语法错误,但我确信你应该使用Execute方法而不是你引用的语句中的Update一词。


-Stewart
Hi. Although it is an Update you want to run, the syntax CurrentDB.Update is not correct. Your Update should still be run using CurrentDB.Execute ([update statement]) just as you did for the INSERT statement.

Execute is used for all types of action queries (insert, delete, update).

What is puzzling is that there is no Update method of the Database object (CurrentDB returns a pointer to the current database object that is in use). I can''t explain why you are getting the error messages you quote, as I would have expected a syntax error of some kind, but I am certain that you should be using the Execute method and not the word Update in the statement you quote.

-Stewart



谢谢 - 我很遗憾地看到,我已经引用了''我的代码错误 - 我使用currentdb.execute(更新)。

ravno

Thank you - I am sorry to see, I''ve ''quoted'' my code wrong - I use the currentdb.execute("Update").
ravno


再次嗨。为什么不尝试使用DoCmd.RunSQL语句呢?它会像这样使用:


DoCmd.RunSQL更新......


关于你的Execute语句DbSeeChanges是一个常量,错误信息毫无意义。如果另一个用户在执行操作查询的同时更改数据,则使用DbSeeChanges选项会生成运行时错误 - 实际上不推荐。


我已附加以下来自Execute命令的Access帮助的摘录我觉得更相关,我建议在执行语句中附上执行(不带DBSeeChanges),如上所述:

Hi again. Why not try the DoCmd.RunSQL statement instead? It would be used like this:

DoCmd.RunSQL "Update ... "

With regard to your Execute statement DbSeeChanges is a constant, and the error message makes no sense. Using the DbSeeChanges option is intended to generate a run-time error if another user is changing the data at the same time as the action query is executed - not recommended really.

I have attached the following extract from the Access help on the Execute command which I do think is more pertinent, and I would suggest enclosing the execute (without DBSeeChanges) in the transaction statements as mentioned:


为了在Microsoft Jet工作区中获得最佳性能,尤其是在多用户环境中,请将执行方法嵌套在事务中。使用工作区对象,然后使用执行方法,并使用工作区上的\dao360.chm :: / damthbegintrans.htmtarget =_ blank> CommitTrans 方法。这样可以保存磁盘上的更改并释放查询运行时放置的任何锁定。
For best performance in a Microsoft Jet workspace, especially in a multiuser environment, nest the Execute method inside a transaction. Use the BeginTrans method on the current Workspace object, then use the Execute method, and complete the transaction by using the CommitTrans method on the Workspace. This saves changes on disk and frees any locks placed while the query is running.



-Stewart

-Stewart


这篇关于MS Access2000前端 - MS SQL2000后端 - dbSeeChanges的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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