Board index » delphi » Empty Memo causes crash w/ IB and D4

Empty Memo causes crash w/ IB and D4

1. I have Delphi 4 C/S along with the BDE, InterBase Client and InterBase
server that came with my Delphi 4 CD.

2. I add a BLOB field to the EMPLOYEE table in the IBLOCAL sample database
like so:

ALTER TABLE EMPLOYEE ADD NOTES BLOB SUB_TYPE 1

3. I create a new project in D4 and drop a TQuery with DatabaseName=IBLOCAL
and the following SQL:

UPDATE EMPLOYEE
SET SALARY=:SALARY, NOTES=:NOTES
WHERE EMP_NO=2

4. Then, I drop a TButton on the form and attach the following code:

Query1.ParamByName('SALARY').AsFloat := 100000;
Query1.ParamByName('NOTES').DataType := ftMemo;
Query1.ParamByName('NOTES').Clear;
Query1.ExecSQL;

5. I get an ACCESS VIOLATION when ExecSQL runs.

I was getting this with my applications where I was using a TUpdateSQL
component. I noticed that I got the EAccessViolation whenever I left my
comments field blank. If there is data in the comments field, then the query
runs fine. i.e. THIS WORKS:

Query1.ParamByName('SALARY').AsFloat := 100000;
Query1.ParamByName('NOTES').DataType := ftMemo;
List := TStringList.Create;
List.Add('Hello World');
Query1.ParamByName('NOTES').Assign(List);
List.Free;
Query1.ExecSQL;

(sigh)

I wish I knew what was happening. I've tried this on multiple workstations
(all running Windows NT 4.0 ws) and I've tried using a local server, TCP/IP
to a remote server, and NetBEUI to a remote server. Still have problems. I'm
going to try the program on a machine that has the old BDE 4.51 installed
and see what happens.

Does anyone have any ideas? This appears to be a bug. (btw, I have installed
the Delphi 4 patch)

TIA,

Dave Prothero
Director of R&D
Argos Software

 

Re:Empty Memo causes crash w/ IB and D4


This is a known bug and is fixed in DELPHI 4 Inline (Updated DELPHI 4 soon to be
released).

T.Ramesh.

Quote
Dave Prothero wrote:
> 1. I have Delphi 4 C/S along with the BDE, InterBase Client and InterBase
> server that came with my Delphi 4 CD.

> 2. I add a BLOB field to the EMPLOYEE table in the IBLOCAL sample database
> like so:

> ALTER TABLE EMPLOYEE ADD NOTES BLOB SUB_TYPE 1

> 3. I create a new project in D4 and drop a TQuery with DatabaseName=IBLOCAL
> and the following SQL:

> UPDATE EMPLOYEE
> SET SALARY=:SALARY, NOTES=:NOTES
> WHERE EMP_NO=2

> 4. Then, I drop a TButton on the form and attach the following code:

> Query1.ParamByName('SALARY').AsFloat := 100000;
> Query1.ParamByName('NOTES').DataType := ftMemo;
> Query1.ParamByName('NOTES').Clear;
> Query1.ExecSQL;

> 5. I get an ACCESS VIOLATION when ExecSQL runs.

> I was getting this with my applications where I was using a TUpdateSQL
> component. I noticed that I got the EAccessViolation whenever I left my
> comments field blank. If there is data in the comments field, then the query
> runs fine. i.e. THIS WORKS:

> Query1.ParamByName('SALARY').AsFloat := 100000;
> Query1.ParamByName('NOTES').DataType := ftMemo;
> List := TStringList.Create;
> List.Add('Hello World');
> Query1.ParamByName('NOTES').Assign(List);
> List.Free;
> Query1.ExecSQL;

> (sigh)

> I wish I knew what was happening. I've tried this on multiple workstations
> (all running Windows NT 4.0 ws) and I've tried using a local server, TCP/IP
> to a remote server, and NetBEUI to a remote server. Still have problems. I'm
> going to try the program on a machine that has the old BDE 4.51 installed
> and see what happens.

> Does anyone have any ideas? This appears to be a bug. (btw, I have installed
> the Delphi 4 patch)

> TIA,

> Dave Prothero
> Director of R&D
> Argos Software

Other Threads