OrthoDocSoft
Programmer
Folks,
From time to time, instances of my software do this, which is basically firing up 3 recordsets and inserting data into three different tables. All the "str..." data is PASSED IN, so it is available:
I have placed code (not shown) right after the "execute" bits that change "lights" (ie, colored shapes) on my form from yellow to red (like a progress bar), and found that the code above can take up to 3-5 seconds to execute. It used to be lightening-fast, but now is that slow. But I haven't changed this code in months, and the problem just started.
Any ideas why this is taking so long and what could be the new problem? I have added new tables to the DB, but that shouldn't affect it I wouldn't think.
Thanks,
Ortho
"you cain't fix 'stupid'...
From time to time, instances of my software do this, which is basically firing up 3 recordsets and inserting data into three different tables. All the "str..." data is PASSED IN, so it is available:
Code:
Dim adoRSFrozens As ADODB.Recordset
Dim adoRSAccessionDesk As ADODB.Recordset
Dim adoRSPathDesk As ADODB.Recordset
Set adoRSFrozens = New ADODB.Recordset
Set adoRSAccessionDesk = New ADODB.Recordset
Set adoRSPathDesk = New ADODB.Recordset
Dim strSQL As String
Dim strSQL2 As String
Dim strSQL3 As String
Dim datDate As Date
Dim datNowTime As Date
adoRSFrozens.Open "frozens", adoConnection, _
adOpenDynamic, adLockOptimistic
adoRSAccessionDesk.Open "accessiondesk", adoConnection, _
adOpenDynamic, adLockOptimistic
adoRSPathDesk.Open "pathdesk", adoConnection, _
adOpenDynamic, adLockOptimistic
On Error GoTo DBErrorHandler
datNowTime = Now
datDate = Date
intValSpecimenIDNumber = Val(strSpecimenIDNumber)
strSQL = "INSERT INTO frozens (FirstName, MI, LastName, DOB," _
& " SessionNumber, History, SpecimenID, SpecimenIDNumber," _
& " MedicalRecordNumber," _
& " PatientEncounterNumber, UniqueNumber, Specimen," _
& " Description, SpecimenType, ORStatus, RecentStatusChange," _
& " Room, Surgeon, Nurse, TimeSent, DateSent) VALUES ('" _
& strFirstName & "', '" & strMI & "', '" & strLastName _
& "', '" & strDOB & "', '" & strSessionNumber & "', '" _
& strHistory & "', '" & strID & "', " _
& intValSpecimenIDNumber & ", '" & strMedicalRecordNumber & "', '" _
& strPatientEncounterNumber & "', '" & strUniqueNumber & "', '" _
& strSpecimen & "', '" _
& strDescr & "', '" & strSpecimenType & "', 'ORSent', 'Yes', '" _
& strRoom & "', '" & strSurgeon & "', '" & strNurse & "', '" _
& datNowTime & "', '" & datDate & "')"
adoConnection.Execute strSQL
strSQL2 = "INSERT INTO accessiondesk (UniqueNumber, Room, ADStatus," _
& " ExcludedFromTAT) VALUES ('" & strUniqueNumber & "', '" & strRoom _
& "', '', '')"
adoConnection.Execute strSQL2
strSQL3 = "INSERT INTO pathdesk (UniqueNumber, Room, Gross," _
& " FrozenDx, DxType, Pathologist, TimeResulted, PathStatus)" _
& " VALUES ('" & strUniqueNumber & "', '" & strRoom _
& "', '', '', '', '', '', '')"
adoConnection.Execute strSQL3
adoRSFrozens.Close
adoRSAccessionDesk.Close
adoRSPathDesk.Close
Set adoRSFrozens = Nothing
Set adoRSAccessionDesk = Nothing
Set adoRSPathDesk = Nothing
I have placed code (not shown) right after the "execute" bits that change "lights" (ie, colored shapes) on my form from yellow to red (like a progress bar), and found that the code above can take up to 3-5 seconds to execute. It used to be lightening-fast, but now is that slow. But I haven't changed this code in months, and the problem just started.
Any ideas why this is taking so long and what could be the new problem? I have added new tables to the DB, but that shouldn't affect it I wouldn't think.
Thanks,
Ortho
![[lookaround] [lookaround] [lookaround]](/data/assets/smilies/lookaround.gif)