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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Call Function From Access Database 1

Status
Not open for further replies.

jtmach

Programmer
Jul 26, 2001
88
0
0
US
I would like to be able to call functions that exist in an access database from my vb application. What is the best way to go about this? Any help you can give would be appreciated. The hardest questions always have the easiest answers.
 
Rewrite them in VB (copy & paste).
Either that or you will have to automate Access.

If you are trying to include them in SQL queries - not possible.
 
Why not just cut and paste the function from Access into your VB program?
nick bulka

 
If by call functions that exist in an access database you mean to you want to execute queries that have been defined in the database, then you can do something like the following:

RecSet.Open &quot;{CALL <QueryName>(&quot; & <Param1> & &quot;)}&quot;, ConnObj

The SQL statement is surrounded by curly braces (may be hard to see in the post) and the parameter list (if any) is surround by parentheses Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein


 
Not heard of that one before - gets a star from me! (Haven't seen many stars today!)
 
Haven't seen many stars in this conference for a while...
 
Thank you for the responses, let me give a few more details on what I want to do. I have and Access 97 database backend with a visual basic frontend. I would like to be able to print Access reports without allowing users access to the backend database. In order to do this I would need to call a PrintReport() function that exists in my Access database from my VB application. The hardest questions always have the easiest answers.
 
hmm, if the users have the ACCESS run time files on their PC then you can do this with the Microsoft Access X.xx Object library. Set a reference to it and create the object.
If they do not have the run time files, then you may want to consider using the Access SnapShotViewer:

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top