Board index » delphi » Re: IBX 6.08, Delphi 6 and null memo field
Bill Todd [TeamB]
Delphi Developer |
Bill Todd [TeamB]
Delphi Developer |
Re: IBX 6.08, Delphi 6 and null memo field2008-02-27 06:15:34 AM delphi137 Have you tried JobQuery.FieldByName('JOB_REQUIREMENT').Clear; -- Bill Todd (TeamB) |
tao lin
Delphi Developer |
2008-02-27 06:28:27 AM
Re: IBX 6.08, Delphi 6 and null memo field
Hi,
I am using Delphi 6 sp2 with IBX 6.08 (I assume this is latest IBX for D6) and IB 6.0.2.0 under Windows XP sp2. I find that no matter how I set a memo field under IBX, IBX always set string '' in the Memo field in the database. And I search the web, and find this dicussion: groups.google.com/group/borland.public.delphi.database.interbaseexpress/browse_thread/thread/2caaf975c47c9d6/5eb119403639b081 Jeff suggest set TMemoField to string '' and IBX will update Interbase as null. Here is a simple test using Employee.Job table: JobQuery is IBQuery, and I use TIBUpdateSQL to post the query. JobQuery.Insert; JobQuery.FieldByName('JOB_CODE').AsString := 'Admin'; JobQuery.FieldByName('JOB_GRADE').AsInteger := 4;; JobQuery.FieldByName('JOB_COUNTRY').AsString := 'England'; JobQuery.FieldByName('JOB_TITLE').AsString := 'MyTest'; JobQuery.FieldByName('MIN_SALARY').AsInteger := 28000; JobQuery.FieldByName('MAX_SALARY').AsInteger := 55000; JobQuery.FieldByName('JOB_REQUIREMENT').AsString := ''; JobQuery.Post; But when I look at the data under IBConsole, the JOB_REQUIREMENT value is '', not null. Can anyone tell me how can I fix this please? Cheers, Tao |
tao lin
Delphi Developer |
2008-02-27 08:00:16 AM
Re: IBX 6.08, Delphi 6 and null memo field
I try both
MemoField.Clear and MemoField.Value = null But no luck, both still update the database as string ''. Cheers, Tao "Bill Todd [TeamB]" <XXXX@XXXXX.COM>writes QuoteHave you tried |
Jeff Overcash (TeamB)
Delphi Developer |
2008-02-27 04:56:54 PM
Re: IBX 6.08, Delphi 6 and null memo field
tao lin writes:
QuoteHi, AsVarient. IBDataset (always the best choice for working with IBX) does not go thru variants. you also should call Clear instead of AsString, but in this case both should result in null being stored with IBDataset. -- Jeff Overcash (TeamB) (Please do not email me directly unless asked. Thank You) And so I patrol in the valley of the shadow of the tricolor I must fear evil. For I am but mortal and mortals can only die. Asking questions, pleading answers from the nameless faceless watchers that stalk the carpeted corridors of Whitehall. (Fish) |
Sabine Dinis Blochberger
Delphi Developer |
2008-02-27 05:53:42 PM
Re: IBX 6.08, Delphi 6 and null memo field
tao lin writes:
QuoteI try both |
tao lin
Delphi Developer |
2008-02-28 09:44:24 AM
Re: IBX 6.08, Delphi 6 and null memo field
Thank you for your suggestion, Jeff. It works!
"> QuoteUse IBDataset instead. IBUpdateSQL assigns params using Variants, |