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!

Can you run a Microsoft Access Macro with Java/JDBC

Status
Not open for further replies.

maynard444

Programmer
Jul 1, 2003
13
0
0
US
I just need to know if there is a way to run a macro or query that is resident in a database in Access. I have found no answer after searching for hours, and It's been a while since I have programmed in JDBC, plus I'm on a time crunch to get it done. Any help would be appreciated. Thanks
Heath
 
Query's in Access I believe are equivalent to a "view" in a *proper* database. They are NOT stored procedures, so cannot be called using CallableStatement.
So if your query is called "Q1" you would execute it thus :

Code:
Connection conn; //create your connection using your preferred driver instantiation method / conn pool
Statement s = conn.createStatement();
ResultSet rs = s.executeQuery("select * from Q1");
while (rs.next()) {
   System.out.println(rs.getString(1));
}

This is obvioiusly a very simple example, and will require some work by you to implement it ..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top