Jump to content

Recommended Posts

Posted

 

Hello, I have a project that needs to use MYSQL , I do not know how to use UDFs to connect , I tried the purple but unavailable , I 've tried following UDFs but sorry, I do not know how all, please help me

I used UDFs and error
MySQL UDFs

Error

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "F:\Dot Kich\TEST_MYSQL.au3"    
"C:\Program Files\AutoIt3\Include\Mysql.au3" (27) : ==> The requested action with this object has failed.:
$Objconn.open ("DRIVER=" & $sDriver & ";SERVER=" & $sServer & ";DATABASE=" & $sDatabase & ";UID=" & $sUsername & ";PWD=" & $sPassword & ";PORT="&$iPort)
$Objconn^ ERROR

Code: 

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <Mysql.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 124)
$SQL_CONNECT = _MySQLConnect("connect_sql","123456","root","127.0.0.1")
_Query($SQL_CONNECT, "UPDATE mytable SET c=c+1 WHERE a=1")
$Label1 = GUICtrlCreateLabel("Label1", 48, 24, 36, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

 

Posted

You can try here:

 

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

But first you should check for provider name.

use 

_ADO_OLEDBProvidersList()

from here:
https://www.autoitscript.com/wiki/ADO_Tools

 

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Which MySQL provider you want to use ?

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)
  On 2/29/2016 at 12:34 AM, mLipok said:

Which MySQL provider you want to use ?

 

Expand  

 

I use MySQL to connect to host my data , and edit it from the application that I have been writing :)

So which one should I use ?? I just like INSERT DATA functions , UPDATE , DELETE and SELECT
Edited by Rechard_Long
Posted

Did you use 

_ADO_OLEDBProvidersList()

Show here the results (as text - I do not want Image).

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 2/29/2016 at 4:26 PM, mLipok said:

Did you use 

_ADO_OLEDBProvidersList()

Show here the results (as text - I do not want Image).

 

Expand  

Use Error:

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\TRANLONG\Desktop\BETA SKIN\New AutoIt v3 Script.au3"    
"C:\Users\TRANLONG\Desktop\BETA SKIN\New AutoIt v3 Script.au3" (54) : ==> Variable used without being declared.:
_ArrayDisplay($aResult, $sTitle, "", 0, Default, "Registry key|OLE DB Provider|Description")
_ArrayDisplay($aResult, ^ ERROR
>Exit code: 1    Time: 80.54

 

Posted

My fault - I recently modified the function.
I fixed this example on Wiki.
Try Again.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 2/29/2016 at 4:26 PM, mLipok said:

Did you use 

_ADO_OLEDBProvidersList()

Show here the results (as text - I do not want Image).

 

Expand  

Row|Registry key|OLE DB Provider|Description
[0]|HKCR\CLSID\{0C7FF16C-38E3-11d0-97AB-00C04FC2AD98}|SQLOLEDB|Microsoft OLE DB Provider for SQL Server
[1]|HKCR\CLSID\{9E175B8B-F52A-11D8-B9A5-505054503030}|Windows Search Data Source|Microsoft OLE DB Provider for Search
[2]|HKCR\CLSID\{c8b522cb-5cf3-11ce-ade5-00aa0044773d}|MSDASQL|Microsoft OLE DB Provider for ODBC Drivers
[3]|HKCR\CLSID\{dee35070-506b-11cf-b1aa-00aa00b8de95}|Microsoft.Jet.OLEDB.4.0|Microsoft Jet 4.0 OLE DB Provider
[4]|HKCR\CLSID\{dfc8bdc0-e378-11d0-9b30-0080c7e9fe95}|MSDAOSP|Microsoft OLE DB Simple Provider
[5]|HKCR\CLSID\{e8cc4cbe-fdff-11d0-b865-00a0c9081c1d}|MSDAORA|Microsoft OLE DB Provider for Oracle
[6]|HKCR\CLSID\{F49C559D-E9E5-467C-8C18-3326AAE4EBCC}|Microsoft.SQLSERVER.CE.OLEDB.3.5|
[7]|HKCR\CLSID\{FB4CDF30-A741-421d-BCFA-6CC530D053FB}|Microsoft.SQLLITE.MOBILE.OLEDB.3.0|
 

Posted (edited)

First you should install MySQL driver for windows.

https://dev.mysql.com/downloads/connector/odbc/

edit:
After install process put here your new list again.

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Re read my edited previous post.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

Re read again my edited pre-previous post ;)

EDIT: a list

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted
  On 3/1/2016 at 8:56 AM, mLipok said:

Re read again my edited pre-previous post ;)

EDIT: a list

Expand  

Row|Registry key|OLE DB Provider|Description
[0]|HKCR\CLSID\{0C7FF16C-38E3-11d0-97AB-00C04FC2AD98}|SQLOLEDB|Microsoft OLE DB Provider for SQL Server
[1]|HKCR\CLSID\{9E175B8B-F52A-11D8-B9A5-505054503030}|Windows Search Data Source|Microsoft OLE DB Provider for Search
[2]|HKCR\CLSID\{c8b522cb-5cf3-11ce-ade5-00aa0044773d}|MSDASQL|Microsoft OLE DB Provider for ODBC Drivers
[3]|HKCR\CLSID\{dee35070-506b-11cf-b1aa-00aa00b8de95}|Microsoft.Jet.OLEDB.4.0|Microsoft Jet 4.0 OLE DB Provider
[4]|HKCR\CLSID\{dfc8bdc0-e378-11d0-9b30-0080c7e9fe95}|MSDAOSP|Microsoft OLE DB Simple Provider
[5]|HKCR\CLSID\{e8cc4cbe-fdff-11d0-b865-00a0c9081c1d}|MSDAORA|Microsoft OLE DB Provider for Oracle
[6]|HKCR\CLSID\{F49C559D-E9E5-467C-8C18-3326AAE4EBCC}|Microsoft.SQLSERVER.CE.OLEDB.3.5|
[7]|HKCR\CLSID\{FB4CDF30-A741-421d-BCFA-6CC530D053FB}|Microsoft.SQLLITE.MOBILE.OLEDB.3.0|
 

Posted

something is wrong.... checking.

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Try new version:

 

Especially: 

  Quote

ADO_EXAMPLE.au3: New Function: _Example_MySQL() - mLipok

Expand  

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

use ADO_EXAMPLE.au3

comment all expect MySQL

;~ _Example_MSAccess()
;~ _Example_MSExcel()
;~ _Example_MSSQL()
_Example_MySQL()
;~ _Example_PostgreSQL()

edit:

Local $sDriver = 'MySQL ODBC 5.2 ANSI Driver' ; 'MySQL ODBC 5.2 UNICODE Driver'
    Local $sServer = 'localhost'
    Local $sDatabase = 'YourBASENAME'
    Local $sPort = '3306'
    Local $sUser = 'YourUserName'
    Local $sPassword = 'YourPassword'

Run

 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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...