Hi Sleepyant,
I think what you're running into is a "filtered" index which may rely on a
function call, for example. When you select data from a Fox table the data
engine reads the indexes to see what data it needs (reading an index is
faster than reading a table) and then retrieves only those rows it needs. Of
course, if there is no available index it will retrieve all the data and
then sort it out locally. You've used a "Select *" SQL command, and I'm not
sure whether that's your actual command or an example.
Do you have any access to FoxPro to open the table and see what the indexes
are? Alternatively, you can read the CDX with Notepad and try to find the
index expressions. When I open a CDX in Notepad I see some relatively empty
stuff at the beginning, followed by whitespace which has the index
expression in the middle of it, preceded by three "square" characters.
Following that is a bunch of "Greek" and then another band of whitespace
with the three squares and the index expression. Have a look and see if you
can provide any more useful information that I could use to attempt to
duplicate your situation.
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com
www.cindywinegarden.com [quoted text, click to view] "sleepyant" <no@no.no> wrote in message
news:OJQCWw$2EHA.2624@TK2MSFTNGP11.phx.gbl...
> Ok, I guess I know what happen. It could be that one of the index key for
> "transac.dbf" which require to "use" some other file as an alias. I think
> I
> could solve it if I run several Foxpro Command (e.g. USE a ALIAS b, SELECT
> 0) before I open this "transac.dbf" table. But how can I run those Foxpro
> command in VB.net, using the Odbc driver? Or is there a way I could ignore
> the index key all together?
>
> Please advise. Thanks in advance.
>
>
> "sleepyant" <no@nono.no> wrote in message
> news:%23lSNjl12EHA.3128@TK2MSFTNGP14.phx.gbl...
>> Hi. I'm using VB.net to access some FoxPro free data table. There are
> aabout
>> 10 DBF files which I can make connection and using select command and
>> fill
>> into a Data Adaptor with no problem. But there is 'one' particulatar DBF
>> file keep having problem. The file name is "transac.dbf" and whenever it
>> read the Data Adapter "Fill" method, it will give the message
> "VFPODBC.DLL:
>> ERROR [S1000] [Microsoft][ODBC Visual FoxPro Driver]Variable ' ' is
> not
>> found.".
>>
>> The following is my code:
>>
>> Dim strConn As String = "Driver={Microsoft Visual FoxPro Driver}" & _
>> ";UID=;SourceType=DBF;SourceDB=D:\Data;" & _
>> ";Null=No;Deleted=Yes;Exclusive=No;Connect Timeout=10"
>>
>> Dim Conn as OdbcConnection = New OdbcConnection(strConn)
>> Conn.Open
>>
>> Dim Da As New OdbcDataAdapter
>> Dim Ds As New DataSet
>> Dim cmdSelect As New OdbcCommand
>>
>> cmdSelect = Conn.CreateCommand
>> cmdSelect.CommandText = "SELECT * FROM transac"
>>
>> Da.SelectCommand = cmdSelect
>>
>> Da.Fill(Ds, "transac") ' <----- Error here.
>>
>> What puzzle me is this only happen with this particlar table
> (transac.dbf),
>> and the rest works fine. I've tried to search for this kind of error but
>> couldn't find any. Please help. Thanks.
>>
>>
>
>