Is there a way to make this faster? If I comment out the two cnSQL.Execute statements, it goes lightning fast, but it is extremely slow with them there. Is there a way to tell ADO to update the Executes only once in a while instead of every time I run the execute statement? I am connecting to an SQL Server using ADO.
Thanks,Code:For x = 1 To ItemCounter cnSQL.Execute "INSERT INTO [CompletedFile] (ID) values(" & x & ")" Do Until iCounter = UBound(NewRecord) If NewRecord(iCounter).ContentID = x Then iCounter = iCounter + 1 strSQL = strSQL & "[" & NewRecord(iCounter).ContentName & "]" & "='" & NewRecord(iCounter).ContentValue & "', " Else lngnewrecord = iCounter + 1 Exit Do End If Loop strSQL = "UPDATE [CompletedFile] SET " & Left(strSQL, Len(strSQL) - 2) & " WHERE [ID] = " & x cnSQL.Execute strSQL strSQL = "" ProgressBar1.Value = ProgressBar1.Value + 1 DoEvents Next
Thai




Reply With Quote