如何使用vb.net中的参数调用Access宏 [英] How to call Access Macros with parameters from vb.net

查看:118
本文介绍了如何使用vb.net中的参数调用Access宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全部好,



我在Access DB中创建了宏。现在我想从Windows Vb.net运行该宏。



这是我的代码....



HI All,

I have created macro in Access DB. Now i want to run that macro from Windows Vb.net.

Here is my code....

Dim oAccess As Object
oAccess = CreateObject("Access.Application")
oAccess.Visible = True
oAccess.OpenCurrentDatabase("\\Asihydfp01n1\it\Soft\IT-US\CSSD\ITS-US-LA\Sucharitha\TestCase\TestC.mdb")
oAccess.DoCmd.RunMAcro("macro1", lbluid)
oAccess.CloseCurrentDatabase()
System.Runtime.InteropServices.Marshal.ReleaseComObject(oAccess)
oAccess = Nothing





************

但它赢了这会影响到DB。

之后我无法打开Access DB。



请提出任何建议





感谢Advnace

Sucharitha



************
But it won't affect in DB.
after this i am not able to open the Access DB.

Please any suggestions


Thanks in Advnace
Sucharitha

推荐答案

首先,阅读我对这个问题的评论。因为你没有回答我,我只能建议......



不要这样做!



而不是调用宏,尝试编写代码来执行与宏相同的操作。
First of all, read my comment to the question. Because you didn't answer me, i can only suggest to...

Don't do this in that way!

Rather than calling macro, try to write code to do the same what macro do.


这篇关于如何使用vb.net中的参数调用Access宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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