
Application-defined error 3315 during table.Update method
Quote:
>I have a piece of 32-bit
Visual Basic 4.0 code which adds a new
>record to a table (happens to be an MS Access database), sets field
>values, and then executes the UPDATE method on the table object. When
>I execute the UPDATE method, I get a run-time error 3315.
>If I inspect the value of ERROR$(3315) it says "User-defined or
>Application-defined error". Any ideas about finding what the actual
>problem is? I've check all the obvious causes of database i/o errors,
>including validation logic in the database itself (which is actually
>non-existant).
>I've tried looking for HLP files for the Jet engine, but can't find
>anything.
>Philip Scott
For the sake of anyone else who has a problem finding error
descriptions on database errors:
I found a set of functions in VB 4.0 related to DAO errors. It's a
DAO Errors() collection. It works like this:
Dim nLastErrIdx as integer
nLastErrIdx = DBEngine.Count -1
If ERR = DBEngine.Errors(nLastErrIdx).Number Then
Debug.Print "Source of Err: " & DBEngine.Errors(nLastErrIdx).Source
Debug.Print "Err Number: " & DBEngine.Errors(nLastErrIdx).Number
Debug.Print "Description: " & DBEngine.Errors(nLastErrIdx).Description
End If
So, using Errors(x).Description, I found that my error was caused by a
field which was marked "Allow Null Value=No", and which had been
asigned no value prior to my table.Update call.
Philip Scott