Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select from unintended table
Message
De
03/04/2003 04:40:27
 
 
À
03/04/2003 03:46:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00773439
Message ID:
00773446
Vues:
22
>Hi All,
>
>I've come across an annoying behaviour which seems strange. With two identical databases (content, names etc) in different paths:
>
>
>OPEN DATABASE myPathA\myDBC
>OPEN DATABASE myPathB\myDBC
>SET DATABASE TO myPathA\myDBC
>USE myView   && View defined in myPathA\DBC "Select * from myDBC!myTable"
>SELECT myTable    && Underlying table opened by View
>? DBF()    && = myPathB\myDBC
>
>
>So VFP has selected from the table in the last opened database rather than the current database ! I know that hardcoding the path into the view definition would avoid the problem but it's not an option in my current situation and I've yet to find an alternative solution.
>
>Any suggestions (except an ER)?
>
>Regards,
>Viv

Viv,

Confirmed.

Workaround just tested using the fullpath of the database
OPEN DATABASE myPathA\myDBC
OPEN DATABASE myPathB\myDBC

=adatabase(pp)
set data to (pp[2,2]) && you will need to verify it is in p[2,2], or loop through pp[] to find the actual row
&& or maybe : set data to ('.\MypathA\Mydbc.dbc')
USE myView
select MyTable
?dbf() && something like C:\project\MypathA\myDBF.DBC
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform