Joost van der Sluis wrote:
Op dinsdag 02-12-2008 om 20:17 uur [tijdzone +1030], schreef Eric March:
  
I am guessing the SQLTransaction1 needs to be set to TRUE before I
can 
set the SQLQuery1 properties.  I get (and expected) an error on
SQLQuery1.
    

But you expected another error, that's why you dind't read it well. (Or
it's too cryptic)
  
Aha!
It was way back in MySQL50Connection1 where I had the problem.
SQLQuery1 properties:
Active = False  "True" gives error = "Transaction of connection not
set" (Expected)
    

The connection also has a 'transaction' property. You haven't set that
one. In principle this isn't necessary if you set ParseSQL to false, ie:
make it readonly. But that's a different story.

That you can't make a transaction active is because MySQL don't support
transactions. But SQLDB enforce you to use them anyway. They are
useless, but they have to be there.

Joost.


  
I have set the connection in MySQL50Connection1to SQLTransaction1
As you point out I still can't set the transaction to True, so I leave it False.

Now when I set SQLQuery1 to True I get an error
".e...e" is an invalid float
_______________________________________________
Lazarus mailing list
[email protected]
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
  
I used to use ADO in Delphi 6, and I don't have enough
knowledge to follow the help I am being given.  Sorry!

on 21/11/08 Tom Lisjac said the steps were:
1   Open a new form . 
Drop a Mysql50
(TMySQL50Connection) on a new form. In the object inspector for this
component, enter the hostname (probably localhost), a database (test
or mysql as an example or a database you've already created) and the
username and password for the database or the "root" you set when
installing mysql. At this point, establishing a successful mysql
connection is being able to set the Connected property to true without
an error.

2. Add Transaction and query
The next step is to add TSQLTransaction and TSQLQuery (a TDataset
descendent) to your form and point them to TMySQL50Connection.
TSQLQuery is used to pass DDL or DML sql statements to the database
and return DML result sets. Put your sql statements in the SQL
stringlist and use the ExecSQL method to execute DDL statements or the
open method to return a DML result set. Adding a TDatasource to the
form and pointing it at the TSQLQuery will allow you to use the data
aware components to display the query results.

3. Use the ExecSQL method.....
I have added the TDatasource with DataSet property = SQLQuery1.
I don't know where I use the "ExecSQL" method.  Should this be on a button?



I am still at step 2 but don't understand step 3.  I can see more
difficulties looming.  Am I following the best path to learn db
applications in Lazarus?

Thanks
Eric March



_______________________________________________
Lazarus mailing list
[email protected]
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to