Joost van der Sluis wrote:
On Tue, 2007-07-03 at 17:55 +1000, John wrote:
  
I have a basic editable connection working now, but there remain a 
number of questions:

1)  When I tried editing in a dbGrid, I had trouble with the field 
length.  Looking through the code, I can't see anywhere where the length 
of a string is checked against the length of the field, and longer 
strings appear to overflow the field / record buffer.  Should this be so 
?  I can fix the problem by doing the edits with a dbEdit control with a 
specified maximum length, but I can't find anything in the dbGrid 
component to do this.  (I presume it would really be the TColumn 
component) 
    

This is more a Lazarus-issue.

  
My real question is, should it be the data control be doing it, or 
should the sql components truncate a string that is too long ?
    

The data-controls. Or you can leave it to the SQL-Server. The official
SQL-specs say that the string should be truncated without any error. But
not all SQL-servers obey that rule...
  
The problem is that if the strings are too long, they overflow the buffer - I think the record buffer in T(Buf)Dataset - and break things before the data gets as far as the database itself.  But I take your point and will have a look at the data controls

That's because sqldb is part of Freepascal, while buttons is part of
Lazarus. 
Ah, that distinction did cross my mind, but I didn't see why it would matter.  I will have a go as you suggested.

Thanks very much for all the help

John Sunderland
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to