Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dbused('dbcname') question
Message
From
30/10/2002 17:19:40
 
 
To
30/10/2002 16:24:20
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00717009
Message ID:
00717147
Views:
50
>
>Nope, that's not it either, :-). First, there are no views with pending changes open in the datasession and second, issuing the close tables does close all of the databases tables as I've examined this from the data session window.
>
>The problem that I am specifically having is with Stonefield database toolkit's method of opening a database, when called via a hook in Visual MaxFrame similar to this;
>
>lcDataDirectory = "c:\myapp\mydatadir1"
>lcDBC = lcDataDirectory + "\master"
>
>oLib.oDBCSvc.OpenData(lcDBC,.t.,.f.)
>
>In my app I'm using the same database name in different data subdirectories, and even if I pass an explicit path to SDT for the database I want to open as a parameter, which is supported btw, the dbused() function as used in the SDT code causes the wrong database to open by just reopening the prior selected database with the same name. If I could get the dbused() function to return .f., I could proceed. If SDT would not use the dbused() function and just open the database in the passed parameter, I could proceed. Given that those are my 2 options right now, you can see why I need the dbused function to return a .f., :-) I'm really stuck on this issue and will have to create a workaround if I can't get it to work this way. :-(


OK, the workaround wasn't really a workaround at all, but was in front of my face the whole time. Once again, Drew has been there, done that and saved my bacon again with the framework. Here's the scoop...there is a method that you can call in the xxfwlibs/cusdbcsvc class called closedata(), geez could it be any more simple than that?. What that method basically does is try to switch the datasession to the datasession that the oMeta SDT object was instantiated in, and issues the close databse there, which is precisely the situation I was in. The database is then successfully closed by issuing the close database in that datasession, the datasession is reset back to the default and life is good....yippee. Thanks again Drew!
Kendall Webb
Senior Software Engineer
MCAD.Net/MCSD.Net
Previous
Reply
Map
View

Click here to load this message in the networking platform