在使用VC ++操作Access数据库时,如何使用嵌入Access 2003的功能(例如"POWER(),LN()")? [英] How to use functions embeded Access 2003 such as "POWER(),LN()",while using VC++ to operate Access DataBase?

查看:171
本文介绍了在使用VC ++操作Access数据库时,如何使用嵌入Access 2003的功能(例如"POWER(),LN()")?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在VC ++中使用SQL来操作Access表时,诸如sin()之类的功能就可以了!

代码:

更新表名设置为Result = POWER(2,2)"是错误的!
调试:
m_pszMsg 0x001774b0"IDispatch错误#3092"
m_strErrorDescription表达功率"功能未定义"

有没有人告诉我如何使这些功能可行.拜托.
(对不起,我的英语不好!再次!)
如果您会中文,可以访问此网站.

http://topic.csdn.net/u/20091129/10/76911454-a507-4359-9def-09887e5d70f1.html [ ^ ]

When I use SQL in VC++ to operate an Access tables, functions such as sin(), are OK!

The code:

"Update tablename set Result=POWER(2,2)" IS wrong!
DEBUG:
m_pszMsg 0x001774b0 "IDispatch error #3092"
m_strErrorDescription "Express ''power'' Function undefined"

Is there anybody to tell me how can make the functions workable. Please.
(Sorry for my poor English!Again!)
You may check this site if you know Chinese.

http://topic.csdn.net/u/20091129/10/76911454-a507-4359-9def-09887e5d70f1.html[^]

推荐答案

您是否尝试过:
Have you tried:
UPDATE TableName SET Result = 2 ^ 2


因此,您真正想做的是从MS Access查询? 此页面说明了如何执行此操作.
So, what you really want to do is call VBA functions from MS Access queries? This page explains how to do that.


我不知道真正跟随你.如果要在Access查询中使用VBA函数,只需创建包装该VBA函数的自己的UDF,然后就可以在Access查询中使用该UDF.而且,如果您想使用VC ++中的某些Access查询功能,则可以从VC ++中对Access DB进行数据库调用.您是说要使用Access查询中的VC ++函数吗?如果是这样,我不知道是否可以做到(尽管我想也可以通过以VBA为中介来实现).
I don''t really follow you. If you want to use a VBA function in an Access query, just create your own UDF that wraps that VBA function, then you can use that UDF in your Access query. And if you want to use some Access query function from VC++, you can make database calls to an Access DB from VC++. Are you saying you want to use VC++ functions from an Access query? If so, I do not know if that can be done (although I imagine that too can be done by going through VBA as an intermediary).


这篇关于在使用VC ++操作Access数据库时,如何使用嵌入Access 2003的功能(例如"POWER(),LN()")?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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