Home > Archive > FoxPro database connector > October 2005 > OLE DB, ODBC & ADO woes using VB6 and FoxPro??









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author OLE DB, ODBC & ADO woes using VB6 and FoxPro??
SifuGreg

2005-10-27, 8:34 am

I have some data files in an unknow foxpro version. I'm writing a little
application which needs to get some info out of it. I've updated all the
latest and greatest ODBC, Foxpro and any other items I can get. If you want
the whole scoop and you have access to Experts-Exchange.com, I encourage you
to read scan it there
(http://www.experts-exchange.com/Pro...Q_21596767.html).
This is a nasty problem and seems like a compatibility problem. Here is the
shortest and simplist example of what is currently going on:
I've set up DSN-less database

Conn.Open strConn
Set rsPets = New ADODB.Recordset
rsPets.CursorType = adOpenKeyset
rsPets.LockType = adLockOptimistic
rsPets.Open "select * from WVSSPET where CAST(PET_CASE AS INT) = 5555",
strConn, , , adCmdText

First problem was solved by the CAST you see above. Although the FoxPro
files was reported as a numeric long integer, it would not compare to 5555 as
a true query but WOULD come back if you said PET_CASE > 5000 and it would
return more than one row. If you said > 5554 and < 5556 it would come up
blank. Very strange, kicked my butt for a long while until I cam up with the
above work around. I moved on to the next leg of the program

I've use similar code above but changed the recordset to read:
rsPets.Open "select * from WVSSCLI where CAST(PET_CLINUM AS INT) = 5555
It returns "ERROR: variable CLI_BALTYPE is not found". Now I can ASSURE
you that CLI_BALTYPE is not a variable anywhere in my code. There is a
field, however, in that table called CLI_BALTYP. I see this when I open it
in Access, VB or CDBF Viewer. No, it's not a typo the letter E is somehow
pulled out of the air here. I think I need a completely different OLE DB or
ODBC driver here. Any suggestions?

--
Greg Fishback
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com