Re: Crash saving boolean value to RS (Row cannot be located...)
From: Brendan Reynolds (brenreyn)
Date: 10/06/04
- Next message: GeorgeB: "Re: Problem with dates,store procedure and ado"
- Previous message: Paul Ralph: "Mdac 2.8 crashes on win 98"
- In reply to: rpotash: "Re: Crash saving boolean value to RS (Row cannot be located...)"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 6 Oct 2004 16:42:13 +0100
Well, as I indicated earlier, a Jet Boolean (Yes/No) field will not store a
Null value, but a numeric field should be OK.
-- Brendan Reynolds (MVP) http://brenreyn.blogspot.com The spammers and script-kiddies have succeeded in making it impossible for me to use a real e-mail address in public newsgroups. E-mail replies to this post will be deleted without being read. Any e-mail claiming to be from brenreyn at indigo dot ie that is not digitally signed by me with a GlobalSign digital certificate is a forgery and should be deleted without being read. Follow-up questions should in general be posted to the newsgroup, but if you have a good reason to send me e-mail, you'll find a useable e-mail address at the URL above. "rpotash" <rpotash@discussions.microsoft.com> wrote in message news:02D91A9A-54F9-42AE-B66D-0638426C1A87@microsoft.com... > Val: I have a PK and it is part of the SELECT statement. > > Brendan: I read a note on ADO translating changes to UPDATE statements and > what you're saying makes sense. The following code works: > > Open RecordSet > With rs > .AddNew > !FullName = "Hello" > .Update > End With > > Close RecordSet > Open RecordSet > With rs > !System = True > .Update > End With > > The issue I'm dealing with is that I was attempting to store the Gender > (True=Male, False=Female, NULL=Not Specified). I haven't tried number > fields. > > BTW, Does anyone know a good lightweight bound Grid Control which allows > me > to change the header and row colorsets? I'm using the Infragistics > UltraGrid > for just this reason but it's forcing me to ADO and has more > properties/events then I need or care to learn about at this point. > > Thanks for the help, > Rich... > > > "Brendan Reynolds" wrote: > >> What if you give the Boolean (Yes/No) field a default value. Does that >> make >> a difference? >> >> I haven't tested this, but here's what I'm thinking ... >> >> In VBA within an Access application, you can assign a Null value to a >> Boolean (Yes/No) field without any error, despite the fact that a Jet >> Boolean (Yes/No) field can not actually store a Null value. The Null gets >> implicitly converted to False. So what I think may be happening here is >> that >> when you create the new record, the value of the Boolean field in the >> recordset is Null, but when the record gets saved, it gets implicitly >> converted to False. If ADO then attempts to find the same record using >> logic >> such as "WHERE TheBooleanField IS NULL .." it won't find it. >> >> -- >> Brendan Reynolds (MVP) >> http://brenreyn.blogspot.com >> >> The spammers and script-kiddies have succeeded in making it impossible >> for >> me to use a real e-mail address in public newsgroups. E-mail replies to >> this post will be deleted without being read. Any e-mail claiming to be >> from brenreyn at indigo dot ie that is not digitally signed by me with a >> GlobalSign digital certificate is a forgery and should be deleted without >> being read. Follow-up questions should in general be posted to the >> newsgroup, but if you have a good reason to send me e-mail, you'll find >> a useable e-mail address at the URL above. >> >> >> "rpotash" <rpotash@discussions.microsoft.com> wrote in message >> news:22E1A4A5-2F65-4C0C-A909-83B7DED00A47@microsoft.com... >> >I am connecting an ADO recordset to an Access table. When adding a new >> > record, if I don't store a value in a boolean field before the first >> > update, >> > the system crashes during subsequent updates of the boolean field. This >> > only >> > seems to happen with booleans. >> > >> > ' This works... >> > With rs >> > .AddNew >> > !System = True ' Yes/No >> > .Update >> > !FullName = "Hello" ' Text >> > .Update >> > !System = True >> > .Update >> > End With >> > >> > >> > ' This crashes... >> > With rs >> > .AddNew >> > !FullName = "Hello" >> > .Update >> > !System = True >> > .Update ' Error (80040e38) Row cannot be >> > located for updating. Some values may have been changed since it was >> > last >> > read. >> > End With >> > >> > >> >> >>
- Next message: GeorgeB: "Re: Problem with dates,store procedure and ado"
- Previous message: Paul Ralph: "Mdac 2.8 crashes on win 98"
- In reply to: rpotash: "Re: Crash saving boolean value to RS (Row cannot be located...)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|