I hate when this happens... if I press TAB + SPACE the message is sent to forum... :-s
-----------------------------
Hi, Larson:
You can't read "the last row written" in a DataBase, as records are not sorted, by definition. You could have a field in a record that grows every time you insert in a table, like AutoNumeric, or DateTime and then you could know exactly wich record is the last one.
Once you know how to get "the last row written" you have to translate it to SQL. Provided you have an AutoNumeric field named "IdRow" in your table "TestTable", you could write:
SELECT * FROM TestTable WHERE IdRow = (MAX(t.IdRow) from TestTable t)
Now you should build a call to the DataBase.
First you need ExecuteQuery, as you did use, and SQL Query input should be the like "SELECT * FROM..."
Second you have to retrieve the data with, for example, "DB Tools Fetch Recordset Data", in DB Palette, next to Execute Query. The output will be a Variant 2D Array that you can convert to anything you want, like String 2D Array, for example using Variant palette functions
And third you have to close the recordset Reference with "DB Tools Free Object", the rightmost function in the same row as Execute Query.
And once you have done all, you can close de DataBase.
Hope it helps,
Aitortxo.