Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Add a Key to a Database Programatically
Message
De
20/09/2015 10:52:14
 
 
À
20/09/2015 10:46:46
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 SP2
OS:
Windows 8
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01624844
Message ID:
01624847
Vues:
57
The INDEX command creates an index. Doesn't matter if it doesn't exist. You may be able to suppress a message with SET MESSAGE OFF


>Thank you for your lightning fast response!
>
>I tried your suggestion but the index is not in the the DBC. Insted I get an error message saying the the index definition for the indexname EMAIL in the CDX could not be found in the database. I can add it as on option in the error message. But I would like to prevent this message as I try to do an update routine for customers with an older version of my app.
>
>Any other idea?
>
>TIA
>Gerhard
>
>>FOREIGN key means it references another table.
>>
>>Try INDEX ON UPPER(Email) TAG EMail
>>
>>
>>
>>
>>>Hello,
>>>
>>>I want to add an index defintion to a DBC programatically. The index is not a primary key, not a cadidate key and not a foreign key. It has no reference to another table.
>>>
>>>I tried
>>>
>>> ALTER TABLE (lcDataPfad + "DPERS.DBF") ADD FOREIGN KEY UPPER(EMAIL) TAG EMAIL
>>>
>>>But that gives an syntax error for the REFERENCE clause is missing.
>>>
>>>How do I add the index definition to the database?
>>>
>>>TIA
>>>Gerhard
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform