[Gambas-user] MySQL data access

David Villalobos Cambronero david_villalobos_c at ...43...
Fri Feb 26 15:12:19 CET 2010


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 <keithclark at ...2185...>
To: gambas-user at lists.sourceforge.net
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
Gambas-user at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user








More information about the User mailing list