Loading DBF file into grid works on some machines

D

Darin

I have 2 developemnt machines here, an XP Pro and 2000 pro. The
following code works on both:

Dim connS As String
Dim tmpConnection As System.Data.OleDb.OleDbConnection
Dim da As System.Data.OleDb.OleDbDataAdapter
Dim ds As DataSet
Dim dt As DataTable
Dim drRow As DataRow
Dim cnt As Integer
Dim strsql As String
Dim xfile As String
xfile = cboFile.Text

'connS = "Driver={Microsoft dBASE Driver
(*.dbf)};DriverID=277;Dbq=\inware\data\df\;"
connS = "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=\inware\data\df\;Extended Properties=dBASE IV;User
ID=Admin;Password="
tmpConnection = New System.Data.OleDb.OleDbConnection(connS)
strsql = "SELECT TOP 100 * FROM " & xfile
strsql = "SELECT * FROM " & xfile
da = New System.Data.OleDb.OleDbDataAdapter(strSQL,
tmpConnection)
ds = New DataSet(xfile)
da.Fill(ds, "Sheet1")
dt = ds.Tables("Sheet1")
gData.DataSource = dt
tmpConnection.Close()

That same code on the customers Win2000 server, XP pro and 2000 Pro
machines all display:

Index not found.

System.Data.OldDb.OleDbException: index not found
etc
etc
etc
at System.Data.Common.DbDataAdapter.Full(DataSet dataSet, String
srcTable)

Any ideas?

Darin
 
T

thomas von daeniken

I have the same problem and no solution found until today. You can
inform me if you got ahead?
I have XP pro and W2003 where to work however different Xp's will not
work

Thomas
 
T

thomas von daeniken

when i take the foxpro-driver for dbase it works on all machines!
(Provider=VFPOLEDB;) the OleDbDriver you can load from internet
Thomas
 

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