LOGGIECROFT
Programmer
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
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