Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trouble opening table with alias
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00168112
Message ID:
00168152
Vues:
22
>>>>>I have a table named zip that is stored on disk as \vfpapps\sc\data\sczip.dbf in a database named sc.
>>>>>
>>>>>I issue the command in one form use zip in 0 and it works fine but in another form it does not work. With the form that it does not work in I get the error message that \vfpapps\sc\zip.dbf is not found. I determined that the database is open by issuing dbused('sc') and it returns true.
>>>>>
>>>>>I cannot determine why I get different results from the exact same commands in 2 different forms.
>>>>>
>>>>>Thanks,
>>>>>
>>>>>Paul
>>>>
>>>>I can't tell you why it works in the one form, but I can tell you why it's not working in the other. If you do USE Zip, it expects to find a table named Zip. If you want an alias, you need to do USE sczip ALIAS zip IN 0.
>>>>
>>>>-Michelle
>>>
>>>Hi Michelle,
>>>
>>>Is this the case even when I have gone in to modi stru for the table and on the 3rd page changed the name of the table to zip? Because I have been doing this with a lot of tables and it has seemed to work except for this one case.
>>>
>>>Sorry for dumb question,
>>>
>>>Paul
>>
>>It can't be too dumb of a question; I didn't even know you could do that! :) In that case, I don't know. Is there some reason you can't just call it what it is?
>>
>>-Michelle
>
>Not necessarily, I have been doing it mainly for readability. And now just curious what is different between the two scenarios where one works and one doesn't.
>
>Paul

That I don't know. I think it's a better practice to call the tables what they are called on the disk. To me, that's more readable. Unless you put comments in there saying what the table is really called. I can just imagine someone coming along and having to modify your code years later and saying "Zip? There's no table named Zip here" As always, YMMV.

-Michelle
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform