Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADO from VB to query FoxPro tables
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00181924
Message ID:
00182042
Vues:
13
>Try...
>SELECT * FROM MainCase WHERE Office + CaseNo Like "198-0000%"
>
>or
>
>SELECT * FROM MainCase WHERE left(Office + CaseNo,8) = "198-0000"

Bob,

Thanks for your reply! I finally figured out the problem after spending much of the day on this. It has to do with SET ANSI ON|OFF. When running an SQL SELECT in VFP, SET ANSI is OFF, while the default for the ODBC drive is ON. This setting determines how SQL comparisons are performed, similar to SET EXACT.

Anyway once I did a oConn.Execute("SET ANSI OFF"), the query worked! I should mention that there is a bug in the previous version of this drive where this setting cannot be turned OFF. (See MS KB Article Q169155.)

Although your solution works, the table is huge, and I cannot create an index for LEFT(...). It appears as though the LIKE clause uses the index (Office + CaseNo); therefore, it works too! This is nice to know.

Thanks again!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform