Jump to content

UDF doesn't work


Recommended Posts

This is the GUI part:

$lbl_hostname = GUICtrlCreateLabel("Hostname:", 20, 30, 55, 17)
                       $hostname = GUICtrlCreateInput("", 110, 30, 121, 21)
               $lbl_username = GUICtrlCreateLabel("Username:", 20, 55, 55, 17)
                       $username = GUICtrlCreateInput("", 110, 55, 121, 21)
               $lbl_passowrd = GUICtrlCreateLabel("Password:", 20, 80, 53, 17)
                       $password = GUICtrlCreateInput("", 110, 80, 121, 21)
               $lbl_database = GUICtrlCreateLabel("Database:", 20, 105, 53, 17)
                       $database = GUICtrlCreateInput("", 110, 105, 121, 21)

And this is the functions who doesn't work

$READ_hostname = GUICtrlRead($hostname)
                       $READ_username = GUICtrlRead($username)
                       $READ_password = GUICtrlRead($password)
                       $READ_database = GUICtrlRead($database)

                               $Connection = _MySQLConnect($READ_username, $READ_password, $READ_database, $READ_hostname)
                               If $READ_database = "" Then
                                       MsgBox(0, "Errore", "Non hai selezionato nessun Database")
                               ElseIf $READ_hostname = "" Then
                                       MsgBox(0, "Errore", "Non hai selezionato nessun Server")
                               ElseIf $READ_username = "" Then
                                       MsgBox(0, "Errore", "Non hai specificato l'Username!")

                               ElseIf @error = 1 Then
                                       MsgBox(0, "Errore", "Impossibile connettersi al database")
                                       MsgBox(0, "Successo", "La connessione al database è avvenuta correttamente." &@CRLF& "Stiamo inviando una query al database!")
                                               $Query = "use `test01`; CREATE TABLE `users` ( `RecordID` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique Record ID', `Username` varchar(30) collate latin1_general_ci NOT NULL, `Password` varchar(30) collate latin1_general_ci NOT NULL, PRIMARY KEY (`RecordID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci"
                                               _Query($Connection, $Query)
                                                       If Not @error Then
                                                               MsgBox(0, "Successo", "La query è stata inviata correttamente.")
                                                               MsgBox(0, "Errore", "Impossibile eseguire la query richiesta.")

Pls if you can.. Resolve this problem.

Link to comment
Share on other sites

so whats the problem, can u tell about that ?

If you see "Impossibile eseguire la query richiesta." that means you got something wrong in your sql query.

btw have you tried to del ;?

$Query = "use `test01`; CREATE TABLE `users`

or delete whole "use `test01`; ".

maybe it helps.

Edited by mistakilla

:alien: ~ Every Living Thing is a Code Snippet of World Application ~ :alien:

Link to comment
Share on other sites

Because there are other UDF for MySQL?

-- Edit --

Ok now i install the OBDC driver.. Can i now execute my script?

Ofcourse :mellow:

is dll version udf and it dont needs ODBC Driver.


Btw reboot your computer and see if it works

:alien: ~ Every Living Thing is a Code Snippet of World Application ~ :alien:

Link to comment
Share on other sites

  • Moderators

You don't provide enough information to help you, I'm not even sure what MySQL.au3 you're using.

Anyway, ProgAndy's works fine for me:

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...