<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Joost van der Sluis wrote:
<blockquote cite="mid:1183453416.24955.20.camel@joost" type="cite">
<pre wrap="">On Tue, 2007-07-03 at 17:55 +1000, John wrote:
</pre>
<blockquote type="cite">
<pre wrap="">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)
</pre>
</blockquote>
<pre wrap=""><!---->
This is more a Lazarus-issue.
</pre>
<blockquote type="cite">
<pre wrap="">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 ?
</pre>
</blockquote>
<pre wrap=""><!---->
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...
</pre>
</blockquote>
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<br>
<br>
<blockquote cite="mid:1183453416.24955.20.camel@joost" type="cite">
<pre wrap="">That's because sqldb is part of Freepascal, while buttons is part of
Lazarus. </pre>
</blockquote>
Ah, that distinction did cross my mind, but I didn't see why it would
matter. I will have a go as you suggested.<br>
<br>
Thanks very much for all the help<br>
<br>
John Sunderland<br>
</body>
</html>