Hi, the acction is called many time beacuse of the _Enter() event. It is called every time the pointer enter the control area.
Regards -- David ----- Original Message ---- From: Keith Clark <[email protected]> To: [email protected] Sent: Thu, February 25, 2010 7:10:46 PM Subject: [Gambas-user] MySQL data access I am having some trouble understanding MySQL access. I am new to Gambas so you may have to take it easy on me! Ok, I followed the instructions as per: http://gambasdoc.org/help/howto/database And I'm now trying to insert my first record into a populated database. Here is my code to do so: PUBLIC SUB ISBN_Enter() DIM $Result AS Result ' DatabaseConnection.Connect() DatabaseConnection.$Con.Begin $Result = DatabaseConnection.$Con.Create("tblStoreSales") ' $Result!salesID = "NULL" ' $Result!Date = Now $Result!ISBN = ISBN.Text $Result!Quantity = 1 $Result!customerID = 0 $Result!merged = 0 $Result!salespersonID = 0 DatabaseConnection.$Con.Commit() ISBN.text = "" END No, when the form opens I call the Connect() instead of every time the text box has changed. Now, when I enter a value into the text box nothing seems to happen for a few moments, then it clears as it is supposed to, but no data is in the table in the database. I'm pretty sure it is connected, as if I put a sting in for a number, it gives me an error. Not sure how to troubleshoot this or even where good documentation is for this type of operation other that what I have shown above. Keith ------------------------------------------------------------------------------ Download IntelĀ® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Gambas-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gambas-user ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Gambas-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gambas-user
