Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB - Accessing DBase tables (.DBF) = VERY SLOW

Status
Not open for further replies.

LOGGIECROFT

Programmer
Oct 1, 2001
5
CA
Can anyone tell me how to speed things up in VB reading a FoxPro table .DBF.
This is the code I have but it takes forever to run!!!!!
Note: My .DBF file is not in a container and is very large!

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Public declaration are in a module!
Public g_objTandemConn As ADODB.Connection
Public g_objRS As ADODB.Recordset
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dim lcSQL As String
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Create SQL filter string
lcSQL = "SELECT PIECE_NUM, METERS, WEIGHT " & _
"FROM WEAVINSP " & _
"WHERE TRIM(WEAVINSP.PIECE_NUM) = '" + Trim(txtNewPieceN.Text) + "'"
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Set a reference to the ADO recordset object
Set g_objRS = New ADODB.Recordset
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Open the recordset object
g_objRS.Open lcSQL, g_objFoxProConn, adOpenForwardOnly, _
adLockReadOnly, adCmdText
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Thanks in advance

 
The first thing I would check is the index on Piece_Num.
 
Thanks RAtkison

I've checked it and there is one on the Piece_Num.
How would this help me out?
There are 234948 "non deleted" records in the table right now.

Is there any other way to access the data so it would speed things up besides ADO?


Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top