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

Access a Stored Procedure in Another Database

Status
Not open for further replies.

dkediger

MIS
Jun 21, 2001
700
US
VFP 6:

Have an inherited project I'm working on. There are two main databases, each with a stored procedure called NEWID that is used for grabbing the last used ID from an ID table in the respective DBC, incrementing by 1, and returning that value.

The ID tables in each DBC contain different sets of ID counters.

My problem is that I'm needing to grab an ID from the DBC that is not open and used.

Is there a way to access the stored procedure in the not active DBC without interfereing with the currently open DBC?
 
No. The DBC must be open to access anything in it - whether data or SPs.

Rick
 
Thanks for the reply!

I've programmed in a conditional section in the active DBC to get my ID, but is there a way when calling the "function" from code to specify which DBC it is in, or is this just a limitation?

 
What you need to do is set the current database to the one you want. See the Help for SET DATABASE TO.

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top