M
Matt Weyland
I keep getting this error Error number 5 and and Error
Number 0 everytiime I execute this code:
Private Sub Update()
On Error GoTo ErrHand
SQL = "UPDATE tblMemo SET subject = " & AddQuotes
(mSubject) & "," & _
"dateReceived =#" & mDateRcvd & "#, " & _
"URL = " & AddQuotes(mQNetURL) & ", " & _
"DateEntered = #" & mDateEntered & "#, " & _
"ServerLocation =" & AddQuotes(mServerLocation) & _
" WHERE MemoID = " & AddQuotes(MemoID)
Set DB = CurrentDb
DB.Execute SQL, dbFailOnError 'this is where this fails
'Set DB = Nothing
ErrHand:
'If Err.Number = 5 Or Err.Number = 0 Then Exit Sub
'Stop
Err.Raise Err.Number, Err.Source, Err.Description
MsgBox "Error: Class: Memo" & vbCrLf & "Method: Private-
Insert" & vbCrLf & Err.Number & ":" & Err.Description
End Sub
I can't seem to figure out why this keeps occuring.
Following is an example of the completed SQL string. Which
when pasted into the SQL designer executes with no errors,
and the code is updating the source table eventhough this
is returning an error.
UPDATE tblMemo SET subject = "This is the
subject",dateReceived =#6/16/2004#, URL = "fff",
DateEntered = #6/16/2004 6:29:35 PM#, ServerLocation
="C:\Work\Training Document.doc" WHERE MemoID = "04-125-CA"
I duplicated this code across several classes and it
everyone is generating the same error. I am quite sure
that I have the correct libraries referenced, but can't
seem to figure this out.
Any assistance anyone can provide on this will be greatly
appreciated.
Number 0 everytiime I execute this code:
Private Sub Update()
On Error GoTo ErrHand
SQL = "UPDATE tblMemo SET subject = " & AddQuotes
(mSubject) & "," & _
"dateReceived =#" & mDateRcvd & "#, " & _
"URL = " & AddQuotes(mQNetURL) & ", " & _
"DateEntered = #" & mDateEntered & "#, " & _
"ServerLocation =" & AddQuotes(mServerLocation) & _
" WHERE MemoID = " & AddQuotes(MemoID)
Set DB = CurrentDb
DB.Execute SQL, dbFailOnError 'this is where this fails
'Set DB = Nothing
ErrHand:
'If Err.Number = 5 Or Err.Number = 0 Then Exit Sub
'Stop
Err.Raise Err.Number, Err.Source, Err.Description
MsgBox "Error: Class: Memo" & vbCrLf & "Method: Private-
Insert" & vbCrLf & Err.Number & ":" & Err.Description
End Sub
I can't seem to figure out why this keeps occuring.
Following is an example of the completed SQL string. Which
when pasted into the SQL designer executes with no errors,
and the code is updating the source table eventhough this
is returning an error.
UPDATE tblMemo SET subject = "This is the
subject",dateReceived =#6/16/2004#, URL = "fff",
DateEntered = #6/16/2004 6:29:35 PM#, ServerLocation
="C:\Work\Training Document.doc" WHERE MemoID = "04-125-CA"
I duplicated this code across several classes and it
everyone is generating the same error. I am quite sure
that I have the correct libraries referenced, but can't
seem to figure this out.
Any assistance anyone can provide on this will be greatly
appreciated.