Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Not same result when going through OleDb
Message
From
17/04/2006 06:16:10
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
16/04/2006 23:49:30
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01113992
Message ID:
01114014
Views:
13
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform