Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a VBA Script in MS Access from VFP 1

Status
Not open for further replies.

jrajesh

Programmer
Aug 12, 2001
72
HK
Hi,
I've created a VBA Script in an MSAccess mdb.
Module name: PBProcs
Function in this module: PbFunc
function have no parameters.

The front-end is VFP and I need to run this function PBFunc from the VFP app.

I've tried the following:
Code:
1. SQLEXEC(Handle, "Execute PbFunc")
2. SQLEXEC(Handle, "Execute PbFunc()")
3. SQLExec(Handle, "Procedure PBFunc()")
None of the above work.

Could some one please help me on this?

Thanks,
Rajesh
 
Try just "EXEC pbFunc". That's what you use in VFP when accessing MS SQL.

Rick
 
Rick,
Tried your suggestion.
No joy.

I still get the error message:
The microsoft Jet Database Engine cannot find the input table or query 'pbFunc'

Thanks for your input.
Regards,
Rajesh
 
This works for me. MyFunctionName resides in Module1, but that doesn't seem to matter.

Brian

Code:
loAccess=CREATEOBJECT("access.application")
loAccess.OpenCurrentDatabase("C:\data\test\test.mdb")
loAccess.visible=.t.
loAccess.Run("MyFunctionName")
 
Brian,
Brilliant.. Thank you.
* for you
Regards,
Rajesh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top