SQL syntax problem with oledb provider for Visual FoxPro

  • Thread starter Jeffry van de Vuurst
  • Start date
J

Jeffry van de Vuurst

Hi,

I've downloaded the Microsoft Visual FoxPro OLE DB Provider. I use it
to connect to a FoxPro database using the Free Table method (there is
no .dbc).

Now I'm having some problems with the sql syntax. I'm trying to use a
CASE statement inside my SELECT statement and I get the error:
"Command contains unrecognized phrase/keyword".

What could be the problem here? Is it that oledb doesn't recognize
this statement or does Visual FoxPro have a problem with it? In the
"old" days, when I connected to sql server through oledb, I had no
problem using the CASE statement, so I'd guess Visual FoxPro has a
problem with it.

I've been looking for an oledb/visual foxpro sql reference, but
without luck.

Any ideas greatly appreciated.

Thanks,
Jeffry van de Vuurst
 
C

Cindy Winegarden

In news: (e-mail address removed),

Hi Jeffry,
I've downloaded the Microsoft Visual FoxPro OLE DB Provider. I use it
to connect to a FoxPro database using the Free Table method (there is
no .dbc).

Now I'm having some problems with the sql syntax. I'm trying to use a
CASE statement inside my SELECT statement and I get the error:
"Command contains unrecognized phrase/keyword".

Try using VFP's IIF( ) function: IIF(lExpression, eExpression1,
eExpression2). IIFs can be nested such as

IIF(nValue = 1, "A", IIF(nValue = 2, "B", IIF(nValue = 3, "C", " ")))

I've been looking for an oledb/visual foxpro sql reference, but
without luck.

In the MSDN Library > Visual Tools and Languages > Visual FoxPro > Visual
FoxPro 8.0 > Product Documentation > Microsoft Visual FoxPro 8.0 > Reference
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top