[Gambas-user] How To INSERT INTO in MySQL?

Robert Juhasz robert1juhasz at ...626...
Mon Feb 6 01:28:05 CET 2012


On 02/06/2012 12:45 AM, abbat wrote:
> I cant make to work the command for MySQL which works perfect on VB.NET
>
>   Dim COMMAND = New MySqlCommand("INSERT INTO statistic ("&
>               "TimeCode, SessionStart, SessionEnd, Kluch, Comp) VALUES ('"&
> T&  "', now(), now(),'"&  kluch&  "','"&  Nc&  "')")
>
> How to make it work?
> Thanks
>
>
Hello,

If you have a connection (e.g. myCon) then you can use it's Exec 
function to execute mysql commands (e.g. myCon.Exec("CREATE VIEW....")).
If your command is a query then returns the result r (called resultset 
in VB, I think), e.g. r=myCon.Exec("SELECT * FROM ...")

Robi




More information about the User mailing list