Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Not same result when going through OleDb
Message
De
17/04/2006 06:16:10
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
16/04/2006 23:49:30
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 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01113992
Message ID:
01114014
Vues:
14
>From .NET, if I use OleDb to access VFP data, I will not get the same result. From VFP, the following SQL find the related records, thus returning all records having DBUsers.Name starting with D:
>
>
>SELECT DBUsers.AI AS FTNumero FROM DBUsers WHERE UPPER(DBUsers.Name)=UPPER("D")
>
>
>But, through OleDb, this returns 0 record. If I don't put any condition, I can see that all records area being returned. So, the problem is related to the way the condition is made. Can anyone explain this difference with OleDb?

Michel,
It has to do with 'set ansi'. With OleDb and odbc driver ansi is on (under VFP it is off by default). Both with ODBC and OleDB driver first make a call to:

set ansi off

if you want the behavior as it's in VFP. ie:
OleDbCommand cmd = new OleDbCommand("set ansi off",cn);
cmd.ExecuteNonQuery();
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform