>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