<div dir="ltr">Thanks so much for responding! I am extremely excited about the prospect of getting this working.<div><br></div><div>Nothing I do in databound controls seems to commit anything to the underlying dataset.</div>
<div><br></div><div>If I open a connection, activate a TSQLQuery with 'SELECT * FROM AnyTable', connect it toa dbgrid, etc. I can delete rows, edit data etc. and it appears to work normally. Changes take effect inside the controls, values change in the dataset, etc. but as soon as I disconnect and reconnect the dataset all my changes are reverted.<br>
</div><div><br><div><div> ODBCConnection1.Connected := TRUE;</div><div> SQLQuery1.SQL.Clear();</div><div> SQLQuery1.SQL.Append('SELECT * FROM AnyTable');</div><div> SQLQuery1.Active := TRUE;</div><div> SQLQuery1.Delete();</div>
<div> SQLQuery1.Edit();</div><div> SQLQuery1['AnyField'] := 'CHANGED';</div><div> SQLQuery1.Post();</div></div></div><div><br></div><div>All of these changes take place in the UI. i.e. the first row is deleted and the field is modified in the second. As soon as I close and re-open the table, both changes are undone.</div>
<div><br></div><div>UPDATE and DELETE queries work as expected.</div><div><br></div><div>Some notes:</div><div>- Calling combinations of StartTransaction / Commit / CommitRetaining don't appear to do anything?</div><div>
- Nothing I do changes the Active property of the associated SQLTransansaction (I'm not actually sure if anything should? Just mentioning it as this feels to me like a commit problem)</div><div>- I have nothing set in the UpdateSQL / DeleteSQL / InsertSQL properties of the TSQLQuery. Are these required when accessing data in this manner?</div>
<div><br></div><div>Thanks again to all who take the time to read this and I hope I'm not just missing something stupid!!</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 13 March 2014 05:25, Reinier Olislagers <span dir="ltr"><<a href="mailto:reinierolislagers@gmail.com" target="_blank">reinierolislagers@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 13/03/2014 00:06, Nathan Wild wrote:<br>
> I have been transitioning my work over from Delphi to Lazarus. For the<br>
> most part it has been smooth and satisfying experience. I'm loving<br>
> Lazarus and FPC and being unburdened by closed source proprietary stuff<br>
> in general.<br>
</div>Good to hear that ;)<br>
<div class=""><br>
> The majority of the work I do requires connections to a Pervasive<br>
> database (from Btrieve v6 all the way up to the most current). I should<br>
> be able to do this via ODBC. I have no problem reading data, executing<br>
> queries, etc. but as soon I try and act on a TSQLQuery using methods<br>
> like .Delete(), .Append(), etc. everything appears to work fine, but as<br>
> soon as the dataset refreshes my changes disappear. I can write to the<br>
> same tables using INSERT, DELETE and UPDATE queries without issue.<br>
><br>
> Am I missing something stupid?<br>
</div>We don't know your code, so no idea... <open door> Are you .Posting the<br>
data?<br>
<br>
To give you an idea, the GUI/RAD tutorials<br>
<a href="http://wiki.lazarus.freepascal.org/SQLdb_Tutorial0" target="_blank">http://wiki.lazarus.freepascal.org/SQLdb_Tutorial0</a><br>
<a href="http://wiki.lazarus.freepascal.org/SQLdb_Tutorial1" target="_blank">http://wiki.lazarus.freepascal.org/SQLdb_Tutorial1</a><br>
and<br>
<a href="http://wiki.lazarus.freepascal.org/SQLdb_Tutorial2" target="_blank">http://wiki.lazarus.freepascal.org/SQLdb_Tutorial2</a><br>
should work with odbc as well as with other dbs; just use odbcconn..<br>
<br>
Also, you could have a look at the database test suite:<br>
<a href="http://wiki.lazarus.freepascal.org/Databases#Running_FPC_database_tests" target="_blank">http://wiki.lazarus.freepascal.org/Databases#Running_FPC_database_tests</a><br>
fpc\packages\fcl-db\tests\dbtestframework.pas<br>
<br>
The info on<br>
<a href="http://wiki.lazarus.freepascal.org/ODBCConn" target="_blank">http://wiki.lazarus.freepascal.org/ODBCConn</a><br>
you probably already know about as you can connect etc.<br>
Please feel free to document any hints/tips/needed additions for<br>
Pervasive there...<br>
<br>
You could create a minimal test program based on<br>
<a href="http://wiki.lazarus.freepascal.org/Database_bug_reporting#FreePascal" target="_blank">http://wiki.lazarus.freepascal.org/Database_bug_reporting#FreePascal</a><br>
and post on the forum<br>
<a href="http://forum.lazarus.freepascal.org/index.php/board,63.0.html" target="_blank">http://forum.lazarus.freepascal.org/index.php/board,63.0.html</a><br>
with an attachment.<br>
<br>
<br>
_______________________________________________<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><b>Nathan T. Wild</b><br><div><br></div></div>
</div>