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
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