Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SP and opening tables
Message
De
07/02/2006 13:20:14
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01094326
Message ID:
01094353
Vues:
15
>Hi everybody,
>
>We have SP with the code like this:
>
>if not used('System_Parameters')
>   use System_Parameters
>endif
>
>where this table is part of the database. The database is included in the project (it's excluded, but it's part of the project).
>
>Now, yesterday I changed our application AddChildren method. The original logic was to instantiate Observer Manager, then FoxAudit, then Stonefield, then Language Manager, then User Log Manager, then Shutdown timer, then Record Track Manager.
>
>I thought, why do we need to instantiate all the managers if we may need to shutdown the application? In other words, I put the timer first. The FoxAudit, Stonefield and Language Manager I commented out, since we're not using them in our application (my colleague told me so). So, the new order of AddChildren is:
>Timer, then UserLogMgr, then Observer Mgr, then Record Track Manager.
>
>The code, that now failed, is in PostInitHook, so it happens after all the managers instantiated. But somehow the change in the instantiation order made this strange error, that the System_Parameters table is not found. Once we added database prefix in that stored procedure, it worked.
>
>But here is a question: if we're opening tables from stored procedure, would it not assume, that tables should belong to that database? Is it possible to execute SP code without opening a database?
>
>I'm confused. Why all of the sudden we need to specify database prefix for the table which is part of the database using that table from SP?
>
>Thanks in advance.

I'd say that the database is not selected, maybe none is or another database is selected

try this
acti screen
?'database =', set('database')
assert set('database') == 'THEONEYOUWOULDEXPECT'

&& debug with =adatab(pp), then look in the debugger to see whether it is opened

if not used('System_Parameters')
  use System_Parameters
endif
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform