Howlsta
Vampire Slayer
- Local time
- Today, 12:23
- Joined
- Jul 18, 2001
- Messages
- 180
I'm doing an export program in VB to export records into Access. I want to add a progress bar as there could be a large number of records. Here's what I've got currently:
pbrExport.Min = 0
pbrExport.Max = mrecData.RecordCount
intCounter = 0
'Do... loop to Add some records to text file
intCounter = intCounter + 1
pbrExport.Value = intCounter
mrecData.MoveNext
Loop Until mrecData.EOF
The problem seems to be that the recordCount is storing -1 as it's value. I've had this problem before, but solved it using OpenKeyset.
However, this time i'm using ADO and don't know how to sort out the problem.
#If ccSQL Then
Set mrecData = mADOConnection.Execute _
("SELECT * FROM [AttendantCircumstances")
#Else
Set mrecData = mADOConnection.Execute _
("SELECT * FROM [Attendant Circumstances]")
#End If
Does anyone have any ideas or is there a better way of doing the progress bar?
Rich
pbrExport.Min = 0
pbrExport.Max = mrecData.RecordCount
intCounter = 0
'Do... loop to Add some records to text file
intCounter = intCounter + 1
pbrExport.Value = intCounter
mrecData.MoveNext
Loop Until mrecData.EOF
The problem seems to be that the recordCount is storing -1 as it's value. I've had this problem before, but solved it using OpenKeyset.
However, this time i'm using ADO and don't know how to sort out the problem.
#If ccSQL Then
Set mrecData = mADOConnection.Execute _
("SELECT * FROM [AttendantCircumstances")
#Else
Set mrecData = mADOConnection.Execute _
("SELECT * FROM [Attendant Circumstances]")
#End If
Does anyone have any ideas or is there a better way of doing the progress bar?
Rich