![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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. |
#3
| |||
| |||
|
|
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 (AT) nono (DOT) no> wrote in message news:%23lSNjl12EHA.3128 (AT) TK2MSFTNGP14 (DOT) 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. |
#4
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |