This is connected to a SQL server 2000 db.
I have a vb6 program that gets this -2147217871 ODBC error occasionally. I am “resuming” back to the line that caused it.
But if the code has an insert statement I think its inserting as many records again.
Say it inserts 40,000 records then gets the error it resumes to inserting, I think it tries to insert those same 40,000 plus the rest it didn’t get. So I end up with way to many which are duplicates.
How do I get around trapping this error so it works correctly?
PS its attempting to insert 140,000 records
DougP, MCP, A+
I have a vb6 program that gets this -2147217871 ODBC error occasionally. I am “resuming” back to the line that caused it.
But if the code has an insert statement I think its inserting as many records again.
Say it inserts 40,000 records then gets the error it resumes to inserting, I think it tries to insert those same 40,000 plus the rest it didn’t get. So I end up with way to many which are duplicates.
How do I get around trapping this error so it works correctly?
Code:
strSQL=” INSERT into [BambooAnalysis].[dbo].[tblAnalysis01] (facid, encounterid, pat...
Set cmdCommand = New adodb.Command
With cmdCommand
.ActiveConnection = gcnDataRepository
.CommandTimeout = 0
.CommandText = strSQL
.CommandType = adCmdText
.Execute ‘<<<<<<<<< Resume comes back here, this caused the error
End With
Select Case Err.Number
Case -2147217871
Resume
…
PS its attempting to insert 140,000 records
DougP, MCP, A+