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!

Add database to project programically

Status
Not open for further replies.

JICGreg

Technical User
Mar 14, 2007
34
The create database command does not automatically add a database to a project. The only help I have been able to find says talks about adding the database manually to the project.

Can the database be added via code to the project? How?

Thanks
 
[cite cbasoz]My project manager doesn't open and keep them open if I don't explicitly tell it to do so[/cite]

But do you see the behavior I describe (take these few steps)? Or aren't you using the native project manager?

Bye, Olaf.
 
I am using the native project manager and it doesn't open and keep the database and/or tables open (unless I explicitly open database and/or tables).

Cetin Basoz
MS Foxpro MVP, MCP
 
BTW I have used up to VFP9 SP1. I don't know if the behavior has changed in SP2.

Cetin Basoz
MS Foxpro MVP, MCP
 
Cetin,

This is what I am seeing:

1. Launch VFP. No database or tables are open.

2. Open a project that contains a database. If the Databases node in the Project Manager is collapsed, there is still no database or tables open.

3. Drill down into the Databases node. No change.

4. Drill down into a specific database. That database will immediately open, and will be set to the current database.

5. Execute CLOSE DATABASES ALL from the command window. The database will remain open, but will no longer be the current database. Whatever you do to close it, it will remain open for as long as the project is open.

Are you seeing something different?

This behaviour has been consistent in all versions of VFP since 3.0. I know that because I always demonstrate it on my training courses when I give a tour of the Project Manager.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Mike,
But I already said "project manager doesn't open and keep them open if I don't explicitly tell it to do so" and you are describing to me how to explicitly open it:)

Cetin Basoz
MS Foxpro MVP, MCP
 
Cetin,

Sorry if I'm misunderstanding you. I'm not certain what you mean.

You say "project manager doesn't open and keep them open". I'm saying that (if you drill down into a database) it does keep the tables open.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Why would you drill down if you don't want to open it. If you are drilling down then you want to open it and it does.

Cetin Basoz
MS Foxpro MVP, MCP
 
Cetin,

I think we agree on this point. It's just a matter of how it's expressed.

In any case, I guess JICGreg has had an answer to his original question - though it would be nice if he would come back here, at least to acknowledge the help he's received.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Cetin,

you're completely right. The point is someone might explicitly tell the project manager to open the database because he wanted to drill down the database node and do something, eg create a new table or add an index in one etc.

Then that person may continue to use the project manager and later explicitly tell the VFP IDE via a CLOSE DATABASE ALL to close all databases, and this is not done. And while the command window is not the project manager window, that IS inconsistent behaviour and can lead to the mischief I described and Mike also explained in detail.

Bye, Olaf.
 
One other point. While we (Cetin and Olaf and Mike and me) know that drilling down into the database in the Project Manager opens it, I don't think that's all that obvious. On the other tabs, you can drill down to see what's inside without opening something. For example, on the Class tab, you can drill into a class library to see what classes it contains without opening it.

I don't think it would be surprising for a user to be surprised that drilling into the database in the PM opens the database.

Tamar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top