ATTN DIRK GOLDGAR: Followup to Overflow Error

  • Thread starter Thread starter MikeV
  • Start date Start date
M

MikeV

Dirk,
Have done what you said and placed the breakpoint on the
cmdSave_click line and stepped through each line until i
got to here: the .CommandText line, the INSERT statement
is what i think is generating the error. Our max records
are set to 10000 and have looked into the tblAuditLog and
it is at 10000 records. Is this the problem or possible
datatype length limits on vchar LogDesc which is set to
100?
Thanks for the help
Mike

Public Sub UpdateAuditLog(strAuditEntry As String,
strAuditEvent As String)
On Error GoTo HandleError

Dim cn As ADODB.Connection
Dim cmdUpdateAuditLog As ADODB.Command
Dim intKey As Integer

'Use the ADO connection that Access uses
Set cn = CurrentProject.AccessConnection

Set cmdUpdateAuditLog = New ADODB.Command
With cmdUpdateAuditLog
Set .ActiveConnection = cn
intKey = GetNextKey(mLOGKEYNAME, mLOGTABLENAME)
If intKey = -1 Then
Err.Raise 513, "Audit Log: Unable to get " &
mLOGKEYNAME & ". Please contact your System Administrator."
End If
.CommandText = "INSERT INTO tblAuditLog (LogId,
StaffId, DateAdded, AuditEvent, LogDesc) VALUES (" &
intKey & "," & gintCurrStaffId & ", GETDATE(), '" &
strAuditEvent & "','" & strAuditEntry & "')"
.Execute
End With

Done:
Exit Sub

HandleError:
DisplayError Err
Resume Done
End Sub
 
MikeV said:
Dirk,
Have done what you said and placed the breakpoint on the
cmdSave_click line and stepped through each line until i
got to here: the .CommandText line, the INSERT statement
is what i think is generating the error. Our max records
are set to 10000 and have looked into the tblAuditLog and
it is at 10000 records. Is this the problem or possible
datatype length limits on vchar LogDesc which is set to
100?
Thanks for the help
Mike

Mike -

I've replied in the original thread. It makes sense to keep the
discussion there, in context.
 
Back
Top