T.R | Title | User | Personal Name | Date | Lines |
---|
2561.1 | suggestion | XSTACY::PATTISON | A rolling stone gets the worm | Thu May 22 1997 07:45 | 7 |
|
Well, thats a Jet 2.5 error message, which suggests that the Access
Database must be an old one (V2.0)
Converting it to a more recent version might be one thing to try.
|
2561.2 | | VMSNET::mickey.alf.dec.com::s_vore | Smile, Mickey's watching! [email protected] | Thu May 22 1997 08:37 | 31 |
| Actually, I've done further research and believe that the error
message is misleading at best ("Communism is just a red herring").
I've created yet another even smaller test project. An Access(95)
database with a single table that has one text, one date, and one
numeric field. Plop a data control and three bound fields on a
form (vb4 or vb5). Move around, update data all you'd like. Make
the text field blank and move to the next record, no problem. Make
the numeric field blank and move to the next record, no problem.
Make the date field blank, though, and you'll get the same error.
In an attempt to get around this, I've tried testing for an empty
field. My problem is this -- how to express an empty date? My
customer wants to allow an empty field rather than using a bogus
hard-coded ancient-history value; what should I put in place of
DateValue("1/1/1900") below?
Private Sub cmd_update_Click()
If IsDate(t2_date) Then
Data1.UpdateRecord
Else
MsgBox ("invalid date")
t2_date = DateValue("1/1/1900")
Data1.UpdateRecord
End If
Data1.Recordset.Bookmark = Data1.Recordset.LastModified
End Sub
-Steven
|
2561.3 | I think... | XSTACY::PATTISON | A rolling stone gets the worm | Thu May 22 1997 09:03 | 9 |
|
Its trying to set the date to a zero-length string (where a NULL is what
you wanted). So what you need to do is over-ride the bound control (only
when its empty) by going directly to the recordset field and setting that
to NULL, before updating.
-Dave
|
2561.4 | oh well. hey, thanks for the info! | VMSNET::mickey.alf.dec.com::s_vore | Smile, Mickey's watching! [email protected] | Thu May 22 1997 12:11 | 6 |
| ooh, ick. That's basicly the "solution" that I've been able to find
via dejanews's usenet archives as well this morning... one would have
though that MS would have a more elegant solution.
-Steven
|