Jump to content

sql syntax update problem


Recommended Posts

hi guy i try to do  an update in  table mysql , but  tell me always sql yntax not correct 

this  my code

_Mysql_Query("UPDATE ge_configurazione SET sop_ragion_social='" &GUICtrlRead($CONF_Input1) & "',sop_via='" &GUICtrlRead($CONF_Input2) & "',sop_citta='" & _
    ""&GUICtrlRead($CONF_Input3) & "',sop_prov='" &GUICtrlRead($CONF_Input4) & "', _sop_mail='" &GUICtrlRead($CONF_Input5) & "',sop_cell='" & _
    ""&GUICtrlRead($CONF_Input6) & "',sop_piva='" & GUICtrlRead($CONF_Input7)& "',sop_codfi='" & GUICtrlRead($CONF_Input8) & "',sop_tel='" & _
    ""& GUICtrlRead($CONF_Input9) & "',sop_fax='" & GUICtrlRead($CONF_Input10) & "',sop_cap='" & GUICtrlRead($CONF_Input11) & "', WHERE id=0'")


error dump
ADO.au3 (954) : ==> COM Error intercepted !
$oADO_Error.description is:     [MySQL][ODBC 5.3(w) Driver][mysqld-5.6.28]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id=0'' at line 1
$oADO_Error.windescription:     Exception occurred.

$oADO_Error.number is:  80020009
$oADO_Error.lastdllerror is:    0
$oADO_Error.scriptline is:  954
$oADO_Error.source is:  Microsoft OLE DB Provider for ODBC Drivers
$oADO_Error.helpfile is:    
$oADO_Error.helpcontext is:     0
###############################

i also   look  here  

 

http://www.w3schools.com/sql/sql_update.asp

 

Link to comment
Share on other sites

6 hours ago, faustf said:

sql syntax not correct 

; check the syntax to use near 'WHERE id=0'' at line 1

 

Try:
 

Local $sop_ragion_social = "'" & GUICtrlRead($CONF_Input1) & "', "
Local $sop_via = "'" & GUICtrlRead($CONF_Input2) & "', "
Local $sop_citta = "'" & GUICtrlRead($CONF_Input3) & "', "
Local $sop_prov = "'" & GUICtrlRead($CONF_Input4) & "', "
Local $_sop_mail = "'" & GUICtrlRead($CONF_Input5) & "', "
Local $sop_cell = "'" & GUICtrlRead($CONF_Input6) & "', "
Local $sop_piva = "'" & GUICtrlRead($CONF_Input7) & "', "
Local $sop_codfi = "'" & GUICtrlRead($CONF_Input8) & "', "
Local $sop_tel = "'" & GUICtrlRead($CONF_Input9) & "', "
Local $sop_fax = "'" & GUICtrlRead($CONF_Input10) & "', "
Local $sop_cap = "'" & GUICtrlRead($CONF_Input11) & "' "

Local $syntax = "UPDATE ge_configurazione SET sop_ragion_social=" & $sop_ragion_social & _
        "sop_via=" & $sop_via & _
        "sop_citta=" & $sop_citta & _
        "sop_prov=" & $sop_prov & _
        "_sop_mail=" & $_sop_mail & _
        "sop_cell=" & $sop_cell & _
        "sop_piva=" & $sop_piva & _
        "sop_codfi=" & $sop_codfi & _
        "sop_tel=" & $sop_tel & _
        "sop_fax=" & $sop_fax & _
        "sop_cap=" & $sop_cap & _
        "WHERE id=0"; "WHERE id='0'"
_Mysql_Query($syntax)

 

Edited by Trong
remove ,

Regards,
 

Link to comment
Share on other sites

Local $sop_cap = "'" & GUICtrlRead($CONF_Input11) & "' "

Remove the extra (invalid) comma on this line.

Edited by jchd

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

i dont know  why go  correctly insert  ok 

but in console  have  this  error 

###############################
ADO.au3 (600) : ==> COM Error intercepted !
$oADO_Error.description is:     Operation is not allowed when the object is closed.
$oADO_Error.windescription:     Exception occurred.

$oADO_Error.number is:  80020009
$oADO_Error.lastdllerror is:    0
$oADO_Error.scriptline is:  600
$oADO_Error.source is:  ADODB.Recordset
$oADO_Error.helpfile is:    C:\Windows\HELP\ADO270.CHM
$oADO_Error.helpcontext is:     1240653
###############################
###############################
ADO.au3 (602) : ==> COM Error intercepted !
$oADO_Error.description is:     Operation is not allowed when the object is closed.
$oADO_Error.windescription:     Exception occurred.

$oADO_Error.number is:  80020009
$oADO_Error.lastdllerror is:    0
$oADO_Error.scriptline is:  602
$oADO_Error.source is:  ADODB.Recordset
$oADO_Error.helpfile is:    C:\Windows\HELP\ADO270.CHM
$oADO_Error.helpcontext is:     1240653
###############################
###############################
ADO.au3 (334) : ==> COM Error intercepted !
$oADO_Error.description is:     Operation is not allowed when the object is closed.
$oADO_Error.windescription:     Exception occurred.

$oADO_Error.number is:  80020009
$oADO_Error.lastdllerror is:    0
$oADO_Error.scriptline is:  334
$oADO_Error.source is:  ADODB.Recordset
$oADO_Error.helpfile is:    C:\Windows\HELP\ADO270.CHM
$oADO_Error.helpcontext is:     1240653
###############################

 

Link to comment
Share on other sites

Show your AutoIt code snippet.

 

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:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

Func _config_azienda()
    _Boom() ; cancella tutto quello che trova su la  gui

    $CONF_Group1 = GUICtrlCreateGroup($GUI_Lang[26], 0, 12, 1692, 757); Configurazione Azienda e Documenti
    $CONF_Group2 = GUICtrlCreateGroup($GUI_Lang[15], 8, 57, 217, 587) ; sede operativa
    $CONF_label1 = GUICtrlCreateLabel($GUI_Lang[1], 19, 79, 82, 17) ; ragione sociale
    $CONF_label2 = GUICtrlCreateLabel($GUI_Lang[2], 19, 131, 19, 17) ; via
    $CONF_label3 = GUICtrlCreateLabel($GUI_Lang[3], 19, 182, 25, 17) ; citta
    $CONF_label4 = GUICtrlCreateLabel($GUI_Lang[4], 19, 339, 21, 17) ; cell
    $CONF_label5 = GUICtrlCreateLabel($GUI_Lang[5], 19, 288, 23, 17) ; mail
    $CONF_label6 = GUICtrlCreateLabel($GUI_Lang[6], 19, 236, 48, 17) ; provincia
    $CONF_label7 = GUICtrlCreateLabel($GUI_Lang[7], 20, 491, 46, 17) ; Telefono
    $CONF_label8 = GUICtrlCreateLabel($GUI_Lang[8], 20, 440, 45, 17) ; cod.fi.
    $CONF_label9 = GUICtrlCreateLabel($GUI_Lang[9], 20, 388, 28, 17) ; P.iva
    $CONF_label10 = GUICtrlCreateLabel($GUI_Lang[10], 20, 597, 34, 17) ; cap
    $CONF_label11 = GUICtrlCreateLabel($GUI_Lang[11], 20, 545, 21, 17) ; fax
    $CONF_Button24 = GUICtrlCreateButton($GUI_Lang[12], 371, 612, 59, 21) ; inserisci
    $CONF_Input1 = GUICtrlCreateInput("", 16, 97, 201, 21)
    $CONF_Input2 = GUICtrlCreateInput("", 17, 150, 201, 21)
    $CONF_Input3 = GUICtrlCreateInput("", 17, 202, 201, 21)
    $CONF_Input4 = GUICtrlCreateInput("", 18, 255, 201, 21)
    $CONF_Input5 = GUICtrlCreateInput("", 18, 307, 201, 21)
    $CONF_Input6 = GUICtrlCreateInput("", 18, 358, 201, 21)
    $CONF_Input7 = GUICtrlCreateInput("", 18, 408, 201, 21)
    $CONF_Input8 = GUICtrlCreateInput("", 19, 459, 201, 21)
    $CONF_Input9 = GUICtrlCreateInput("", 19, 511, 201, 21)
    $CONF_Input10 = GUICtrlCreateInput("", 19, 563, 201, 21)
    $CONF_Input11 = GUICtrlCreateInput("", 20, 616, 57, 21)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $CONF_Group3 = GUICtrlCreateGroup($GUI_Lang[13], 228, 57, 217, 587) ; Sede legale
    $CONF_label10 = GUICtrlCreateLabel($GUI_Lang[1], 239, 79, 82, 17) ; ragione sociale
    $CONF_label11 = GUICtrlCreateLabel($GUI_Lang[2], 239, 130, 19, 17) ; via
    $CONF_Label12 = GUICtrlCreateLabel($GUI_Lang[3], 239, 181, 25, 17) ; città
    $CONF_Label13 = GUICtrlCreateLabel($GUI_Lang[4], 239, 338, 21, 17) ; cell
    $CONF_Label14 = GUICtrlCreateLabel($GUI_Lang[5], 239, 287, 23, 17) ; mail
    $CONF_Label15 = GUICtrlCreateLabel($GUI_Lang[6], 239, 235, 48, 17) ; provincia
    $CONF_Label16 = GUICtrlCreateLabel($GUI_Lang[7], 240, 490, 46, 17) ; telefono
    $CONF_Label17 = GUICtrlCreateLabel($GUI_Lang[8], 240, 439, 45, 17) ; codice fiscale
    $CONF_Label18 = GUICtrlCreateLabel($GUI_Lang[9], 240, 387, 28, 17) ; p.iva
    $CONF_Label19 = GUICtrlCreateLabel($GUI_Lang[10], 240, 596, 34, 17); cap
    $CONF_Label20 = GUICtrlCreateLabel($GUI_Lang[11], 240, 544, 21, 17); fax
    $CONF_Input12 = GUICtrlCreateInput("", 235, 98, 201, 21)
    $CONF_Input13 = GUICtrlCreateInput("", 236, 151, 201, 21)
    $CONF_Input14 = GUICtrlCreateInput("", 236, 203, 201, 21)
    $CONF_Input15 = GUICtrlCreateInput("", 237, 256, 201, 21)
    $CONF_Input16 = GUICtrlCreateInput("", 237, 308, 201, 21)
    $CONF_Input17 = GUICtrlCreateInput("", 237, 359, 201, 21)
    $CONF_Input18 = GUICtrlCreateInput("", 237, 409, 201, 21)
    $CONF_Input19 = GUICtrlCreateInput("", 238, 460, 201, 21)
    $CONF_Input20 = GUICtrlCreateInput("", 238, 512, 201, 21)
    $CONF_Input21 = GUICtrlCreateInput("", 238, 564, 201, 21)
    $CONF_Input22 = GUICtrlCreateInput("", 239, 617, 57, 21)
    $CONF_Button23 = GUICtrlCreateButton($GUI_Lang[12], 148, 614, 59, 21) ; Inserisci
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $CONF_Checkbox1 = GUICtrlCreateCheckbox($GUI_Lang[16], 368, 32, 73, 17, BitOR($GUI_SS_DEFAULT_CHECKBOX, $BS_RIGHTBUTTON, $BS_RIGHT)) ; se uguale
    $CONF_Group4 = GUICtrlCreateGroup($GUI_Lang[17], 8, 648, 438, 113) ; loghi fattura
    $CONF_Input23 = GUICtrlCreateInput("", 16, 696, 121, 21,BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY)); path logo
    $CONF_Label23 = GUICtrlCreateLabel($GUI_Lang[18], 16, 680, 69, 13) ; logo azienda
    $CONF_Button1 = GUICtrlCreateButton($GUI_Lang[19], 144, 696, 59, 21) ; scegli
    $CONF_Label24 = GUICtrlCreateLabel($GUI_Lang[20], 248, 678, 62, 14) ; carica
    $CONF_Input24 = GUICtrlCreateInput("", 248, 696, 121, 21,BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY)) ; path banka
    $CONF_Button2 = GUICtrlCreateButton($GUI_Lang[19], 376, 696, 59, 21) ; scegli
    $CONF_Button3 = GUICtrlCreateButton($GUI_Lang[20], 145, 730, 59, 21) ; carica
    $CONF_Button4 = GUICtrlCreateButton($GUI_Lang[20], 377, 730, 59, 21) ; carica
    $CONF_Label25 = GUICtrlCreateLabel($GUI_Lang[21], 16, 724, 89, 13) ; max 4288x4288
    $CONF_Label26 = GUICtrlCreateLabel($GUI_Lang[22], 16, 739, 71, 17) ; max 300 dpi
    $CONF_Label27 = GUICtrlCreateLabel($GUI_Lang[21], 248, 723, 89, 17) ; max 4288x4288
    $CONF_Label28 = GUICtrlCreateLabel($GUI_Lang[22], 248, 738, 71, 17) ; max 300 dpi
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $CONF_Group5 = GUICtrlCreateGroup($GUI_Lang[23], 448, 27, 161, 305) ; costi
    $CONF_Input25 = GUICtrlCreateInput("", 456, 67, 57, 21 )
    $CONF_Label29 = GUICtrlCreateLabel($GUI_Lang[24], 456, 51, 141, 12) ;diritt. chiamata azendale
    $CONF_Button5 = GUICtrlCreateButton($GUI_Lang[25], 536, 67, 59, 21); setta
    $CONF_Input26 = GUICtrlCreateInput("", 457, 112, 57, 21)
    $CONF_Button6 = GUICtrlCreateButton($GUI_Lang[25], 537, 112, 59, 21); setta
    $CONF_Label31 = GUICtrlCreateLabel($GUI_Lang[26], 458, 97, 109, 12) ; costo orario aziendale
    $CONF_Input27 = GUICtrlCreateInput("", 458, 159, 57, 21)
    $CONF_Button7 = GUICtrlCreateButton($GUI_Lang[25], 538, 159, 59, 21) ; setta
    $CONF_Label32 = GUICtrlCreateLabel($GUI_Lang[27], 459, 190, 96, 13) ; costo orario privato
    $CONF_Input28 = GUICtrlCreateInput("", 459, 206, 57, 21)
    $CONF_Button8 = GUICtrlCreateButton($GUI_Lang[25], 539, 206, 59, 21) ; setta
    $CONF_Label33 = GUICtrlCreateLabel($GUI_Lang[28], 459, 238, 70, 14) ; iva in corso %
    $CONF_Input29 = GUICtrlCreateInput("", 459, 254, 57, 21)
    $CONF_Button9 = GUICtrlCreateButton($GUI_Lang[25], 539, 254, 59, 21) ; setta
    $CONF_Label34 = GUICtrlCreateLabel($GUI_Lang[29], 459, 287, 79, 14) ; ricarico minimo
    $CONF_Input30 = GUICtrlCreateInput("", 459, 303, 57, 21)
    $CONF_Button10 = GUICtrlCreateButton($GUI_Lang[25], 539, 303, 59, 21) ; setta
    $CONF_Label30 = GUICtrlCreateLabel($GUI_Lang[30], 459, 144, 128, 13) ; diritto di chiamata privato
    GUICtrlCreateGroup("", -99, -99, 1, 1)

    $CONF_Group6 = GUICtrlCreateGroup($GUI_Lang[31], 1300, 572, 281, 189) ; fattura tipo documento
    $CONF_List1 = GUICtrlCreateListView("", 1304, 589, 273, 110)
    _GUICtrlListView_SetExtendedListViewStyle($CONF_List1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_SUBITEMIMAGES)) ; questa stringa fa la griglia stile excel
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 220)
    _GUICtrlListView_InsertColumn($CONF_List1, 0, $GUI_Lang[31], 266)
    $CONF_Input31 = GUICtrlCreateInput("", 1369, 708, 121, 21)
    $CONF_Button11 = GUICtrlCreateButton($GUI_Lang[32], 1305, 708, 59, 21) ; cerca
    $CONF_Button12 = GUICtrlCreateButton($GUI_Lang[33], 1306, 735, 59, 21) ; aggiungi
    GUICtrlCreateGroup("", -99, -99, 1, 1)

    $CONF_Group8 = GUICtrlCreateGroup($GUI_Lang[35], 449, 572, 281, 189) ; DDT tipo doc
    $CONF_List3 = GUICtrlCreateListView("", 453, 589, 273, 110)
    _GUICtrlListView_SetExtendedListViewStyle($CONF_List3, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_SUBITEMIMAGES)) ; questa stringa fa la griglia stile excel
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 220)
    _GUICtrlListView_InsertColumn($CONF_List3, 0, $GUI_Lang[35], 266)
    $CONF_Input33 = GUICtrlCreateInput("", 518, 708, 121, 21)
    $CONF_Button15 = GUICtrlCreateButton($GUI_Lang[32], 454, 708, 59, 21) ;  cerca
    $CONF_Button16 = GUICtrlCreateButton($GUI_Lang[33], 455, 735, 59, 21) ; aggiungi
    GUICtrlCreateGroup("", -99, -99, 1, 1)

    $CONF_Group7 = GUICtrlCreateGroup($GUI_Lang[34], 1016, 572, 281, 190) ; modalità di pagamento
    $CONF_List2 = GUICtrlCreateListView("", 1020, 589, 273, 110)
    _GUICtrlListView_SetExtendedListViewStyle($CONF_List2, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_SUBITEMIMAGES)) ; questa stringa fa la griglia stile excel
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 220)
    _GUICtrlListView_InsertColumn($CONF_List2, 0, $GUI_Lang[34], 266)
    $CONF_Input32 = GUICtrlCreateInput("", 1085, 708, 121, 21)
    $CONF_Button13 = GUICtrlCreateButton($GUI_Lang[32], 1021, 708, 59, 21) ; cerca
    $CONF_Button14 = GUICtrlCreateButton($GUI_Lang[33], 1022, 735, 59, 21) ; aggiungi
    GUICtrlCreateGroup("", -99, -99, 1, 1)

    $CONF_Group9 = GUICtrlCreateGroup($GUI_Lang[36], 732, 572, 281, 189) ; tipologia documento
    $CONF_List4 = GUICtrlCreateListView("", 736, 589, 273, 110)
    _GUICtrlListView_SetExtendedListViewStyle($CONF_List4, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_GRIDLINES, $LVS_EX_SUBITEMIMAGES)) ; questa stringa fa la griglia stile excel
    GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 220)
    _GUICtrlListView_InsertColumn($CONF_List4, 0, $GUI_Lang[36], 266)
    $CONF_Input34 = GUICtrlCreateInput("", 801, 708, 121, 21)
    $CONF_Button17 = GUICtrlCreateButton($GUI_Lang[32], 737, 708, 59, 21) ; cerca
    $CONF_Button18 = GUICtrlCreateButton($GUI_Lang[33], 738, 735, 59, 21) ; aggiungi

    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $CONF_Button19 = GUICtrlCreateButton($GUI_Lang[37], 603, 517, 123, 25) ; dati connessione db
    $CONF_Group10 = GUICtrlCreateGroup($GUI_Lang[38], 612, 27, 1075, 305) ; permessi Utnti
    $CONF_List5 = GUICtrlCreateList("", 615, 43, 1068, 253)
    $CONF_Button20 = GUICtrlCreateButton($GUI_Lang[44], 1606, 301, 75, 21) ; salva
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $CONF_Group11 = GUICtrlCreateGroup($GUI_Lang[39], 448, 343, 283, 161) ; Creazione e modifica utenti
    $CONF_Label35 = GUICtrlCreateLabel($GUI_Lang[40], 603, 366, 67, 11) ; Nome Utente
    $CONF_Label36 = GUICtrlCreateLabel($GUI_Lang[41], 460, 367, 26, 13) ; login
    $CONF_Input36 = GUICtrlCreateInput("", 459, 383, 121, 21)
    $CONF_Label37 = GUICtrlCreateLabel($GUI_Lang[42], 461, 407, 50, 12) ; password
    $CONF_Input37 = GUICtrlCreateInput("", 460, 423, 121, 21)
    $CONF_Input38 = GUICtrlCreateInput("", 460, 474, 122, 21)
    $CONF_Input35 = GUICtrlCreateInput("", 602, 382, 121, 21)
    $CONF_Label38 = GUICtrlCreateLabel($GUI_Lang[5], 461, 458, 23, 13) ; mail
    $CONF_Button22 = GUICtrlCreateButton($GUI_Lang[44], 647, 420, 75, 21) ; salva
    $CONF_Button21 = GUICtrlCreateButton($GUI_Lang[43], 588, 474, 75, 21) ; invia dati
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUICtrlCreateGroup("", -99, -99, 1, 1)

    GUICtrlSetOnEvent($CONF_Button19, "_DB_Param") ; dati database azienda
    GUICtrlSetOnEvent($CONF_Button12, "_Fatt_Doc") ; Tasto Aggiungi fattura doc
    GUICtrlSetOnEvent($CONF_Button14, "_MOD_Pag") ; Tasto Aggiungi mod pag
    GUICtrlSetOnEvent($CONF_Button18, "_Tipo_Doc") ; Tasto Aggiungi Tipo doc
    GUICtrlSetOnEvent($CONF_Button16, "_Doc_DDT") ; Tasto Aggiungi Doc DDT
    GUICtrlSetOnEvent($CONF_Button15, "_cerca_DDT") ; tasto cerca per DDT tipo documento
    GUICtrlSetOnEvent($CONF_Button11, "_cerca_Fatt") ; tasto cerca per fattura tipo documento
    GUICtrlSetOnEvent($CONF_Button13, "_cerca_ModPAG") ; tasto cerca per modo pagamento
    GUICtrlSetOnEvent($CONF_Button17, "_cerca_TypeDOC") ; tasto cerca per tipo documento
    GUICtrlSetOnEvent($CONF_Button1, "_loghi_foto_azienda_up_load") ; tasto scegli foto logo azienda
    GUICtrlSetOnEvent($CONF_Button3, "_loghi_foto_azienda_up") ; tasto inserisci in db path logo azienda
    GUICtrlSetOnEvent($CONF_Button2, "_loghi_foto_bank_up_load") ; tasto scegli foto logo banka
    GUICtrlSetOnEvent($CONF_Button4, "_loghi_foto_bank_up") ; tasto scegli foto logo banka
    GUICtrlSetOnEvent($CONF_Checkbox1, "_se_uguale_checkbox") ; check box se uguale
    GUICtrlSetOnEvent($CONF_Button23, "_insert_sede_operativa") ; inserisce la sede operativa
    GUICtrlSetOnEvent($CONF_Button24, "_insert_sede_Legale") ; inserisce la sede Legale
    GUICtrlSetOnEvent($CONF_Button5, "_insert_DCA") ; inserisce diritto di chiamata aziendale
    GUICtrlSetOnEvent($CONF_Button6, "_insert_COA") ; inserisce costo orario aziendale
    GUICtrlSetOnEvent($CONF_Button7, "_insert_DCP") ; inserisce diritto di chiamata privato
    GUICtrlSetOnEvent($CONF_Button8, "_insert_COP") ; inserisce costo orario privato
    GUICtrlSetOnEvent($CONF_Button9, "_insert_IVA_corso") ; inserisce iva in corso
    GUICtrlSetOnEvent($CONF_Button10, "_insert_Ricarico_MIN") ; inserisce ricarico minimo

    _Read_ini_Multi_Output(0, $CONF_List1, 'motifFAT.ini', 'fattura_motivazioni', 'key') ; popola  fattura tipo documento
    _Read_ini_Multi_Output(0, $CONF_List2, 'motifTPAGA.ini', 'Pagamento_motivazioni', 'key') ; popola  modalità di pagamento
    _Read_ini_Multi_Output(0, $CONF_List3, 'motifDDT.ini', 'DDT_motivazioni', 'key') ; popola  ddt documenti
    _Read_ini_Multi_Output(0, $CONF_List4, 'motifCONTI.ini', 'Pagamento_Conti', 'key') ; popola tipologia documento


    _popola_configurazione_dati()

EndFunc   ;==>_config_azienda


; ++++++++++++++++++++++++++ configurazione ++++++++++++++++++++++++++++++++++++++++++
Func _insert_DCA()
    Local $DCA = "'" & GUICtrlRead($CONF_Input25) & "' "
    Local $syntax = "UPDATE ge_configurazione SET dca=" & $DCA & _
            "WHERE id=0"
    _Mysql_Query($syntax)
    If @error Then
        SetError(@error, @extended, $ADO_RET_FAILURE)
    Else
        MsgBox(0, $GUI_Lang[45], $GUI_Lang[48])
    EndIf

EndFunc   ;==>_insert_DCA
Func _insert_COA()
    Local $COA = "'" & GUICtrlRead($CONF_Input26) & "' "
    Local $syntax = "UPDATE ge_configurazione SET coa=" & $COA & _
            "WHERE id=0"
    _Mysql_Query($syntax)
    If @error Then
        SetError(@error, @extended, $ADO_RET_FAILURE)
    Else
        MsgBox(0, $GUI_Lang[45], $GUI_Lang[48])
    EndIf

EndFunc   ;==>_insert_COA
Func _insert_DCP()
    Local $DCP = "'" & GUICtrlRead($CONF_Input27) & "' "
    Local $syntax = "UPDATE ge_configurazione SET dcp=" & $DCP & _
            "WHERE id=0"
    _Mysql_Query($syntax)
    If @error Then
        SetError(@error, @extended, $ADO_RET_FAILURE)
    Else
        MsgBox(0, $GUI_Lang[45], $GUI_Lang[48])
    EndIf

EndFunc   ;==>_insert_DCP
Func _insert_COP()
    Local $COP = "'" & GUICtrlRead($CONF_Input28) & "' "
    Local $syntax = "UPDATE ge_configurazione SET cop=" & $COP & _
            "WHERE id=0"
    _Mysql_Query($syntax)
    If @error Then
        SetError(@error, @extended, $ADO_RET_FAILURE)
    Else
        MsgBox(0, $GUI_Lang[45], $GUI_Lang[48])
    EndIf

EndFunc   ;==>_insert_COP
Func _insert_IVA_corso()
    Local $IVAC = "'" & GUICtrlRead($CONF_Input29) & "' "
    Local $syntax = "UPDATE ge_configurazione SET iva_corso=" & $IVAC & _
            "WHERE id=0"
    _Mysql_Query($syntax)
    If @error Then
        SetError(@error, @extended, $ADO_RET_FAILURE)
    Else
        MsgBox(0, $GUI_Lang[45], $GUI_Lang[48])
    EndIf

EndFunc   ;==>_insert_IVA_corso
Func _insert_Ricarico_MIN()
    Local $RMin = "'" & GUICtrlRead($CONF_Input30) & "' "
    Local $syntax = "UPDATE ge_configurazione SET ricarico_minimo=" & $RMin & _
            "WHERE id=0"
    _Mysql_Query($syntax)
    If @error Then
        SetError(@error, @extended, $ADO_RET_FAILURE)
    Else
        MsgBox(0, $GUI_Lang[45], $GUI_Lang[48])
    EndIf

EndFunc   ;==>_insert_Ricarico_MIN


Func _insert_double() ;  funzione  di inserimento sede legale e operativa quando uguali
    $CC = 1
    _insert_sede_Legale()
    _insert_sede_operativa()

EndFunc   ;==>_insert_double


Func _insert_sede_Legale() ; funzione inserimento solo sede  legale

    Local $sLeg_ragion_social = "'" & GUICtrlRead($CONF_Input12) & "', "
    Local $sLeg_via = "'" & GUICtrlRead($CONF_Input13) & "', "
    Local $sLeg_citta = "'" & GUICtrlRead($CONF_Input14) & "', "
    Local $sLeg_prov = "'" & GUICtrlRead($CONF_Input15) & "', "
    Local $sLeg_mail = "'" & GUICtrlRead($CONF_Input16) & "', "
    Local $sLeg_cell = "'" & GUICtrlRead($CONF_Input17) & "', "
    Local $sLeg_piva = "'" & GUICtrlRead($CONF_Input18) & "', "
    Local $sLeg_codfi = "'" & GUICtrlRead($CONF_Input19) & "', "
    Local $sLeg_tel = "'" & GUICtrlRead($CONF_Input20) & "', "
    Local $sLeg_fax = "'" & GUICtrlRead($CONF_Input21) & "', "
    Local $sLeg_cap = "'" & GUICtrlRead($CONF_Input22) & "' "

    Local $syntax = "UPDATE ge_configurazione SET sl_ragion_social=" & $sLeg_ragion_social & _
            "sl_via=" & $sLeg_via & _
            "sl_citta=" & $sLeg_citta & _
            "sl_prov=" & $sLeg_prov & _
            "sl_mail=" & $sLeg_mail & _
            "sl_cell=" & $sLeg_cell & _
            "sl_piva=" & $sLeg_piva & _
            "sl_codfi=" & $sLeg_codfi & _
            "sl_tel=" & $sLeg_tel & _
            "sl_fax=" & $sLeg_fax & _
            "sl_cap=" & $sLeg_cap & _
            "WHERE id=0"; "WHERE id='0'"
    _Mysql_Query($syntax)
    If @error Then
        SetError(@error, @extended, $ADO_RET_FAILURE)
    Else
        If $CC = 0 Then
            MsgBox(0, $GUI_Lang[45], $GUI_Lang[48])
        EndIf
    EndIf

EndFunc   ;==>_insert_sede_Legale


Func _insert_sede_operativa() ; funzione di inserimento solo sede operativa

    Local $sop_ragion_social = "'" & GUICtrlRead($CONF_Input1) & "', "
    Local $sop_via = "'" & GUICtrlRead($CONF_Input2) & "', "
    Local $sop_citta = "'" & GUICtrlRead($CONF_Input3) & "', "
    Local $sop_prov = "'" & GUICtrlRead($CONF_Input4) & "', "
    Local $sop_mail = "'" & GUICtrlRead($CONF_Input5) & "', "
    Local $sop_cell = "'" & GUICtrlRead($CONF_Input6) & "', "
    Local $sop_piva = "'" & GUICtrlRead($CONF_Input7) & "', "
    Local $sop_codfi = "'" & GUICtrlRead($CONF_Input8) & "', "
    Local $sop_tel = "'" & GUICtrlRead($CONF_Input9) & "', "
    Local $sop_fax = "'" & GUICtrlRead($CONF_Input10) & "', "
    Local $sop_cap = "'" & GUICtrlRead($CONF_Input11) & "' "

    Local $syntax = "UPDATE ge_configurazione SET sop_ragion_social=" & $sop_ragion_social & _
            "sop_via=" & $sop_via & _
            "sop_citta=" & $sop_citta & _
            "sop_prov=" & $sop_prov & _
            "sop_mail=" & $sop_mail & _
            "sop_cell=" & $sop_cell & _
            "sop_piva=" & $sop_piva & _
            "sop_codfi=" & $sop_codfi & _
            "sop_tel=" & $sop_tel & _
            "sop_fax=" & $sop_fax & _
            "sop_cap=" & $sop_cap & _
            "WHERE id=0"; "WHERE id='0'"
    _Mysql_Query($syntax)
    If @error Then
        SetError(@error, @extended, $ADO_RET_FAILURE)
    Else
        MsgBox(0, $GUI_Lang[45], $GUI_Lang[48])
    EndIf

EndFunc   ;==>_insert_sede_operativa


Func _loghi_foto_bank_up_load()

    _open_dialog_file_configure_loghi("Immagine Logo Banca solo in jpg", $CONF_Input24)

EndFunc   ;==>_loghi_foto_bank_up_load

Func _loghi_foto_azienda_up()
    Local $path_logho = "'" & GUICtrlRead($CONF_Input23) & "' "
    If $path_logho = '' Then
        MsgBox(0, $GUI_Lang[49], $GUI_Lang[50])
    Else
        Local $syntax = "UPDATE ge_configurazione SET path_logo=" & $path_logho & _
                "WHERE id=0"
        _Mysql_Query($syntax)
        If @error Then
            SetError(@error, @extended, $ADO_RET_FAILURE)
        Else
            MsgBox(0, $GUI_Lang[45], $GUI_Lang[48])
        EndIf
    EndIf
EndFunc   ;==>_loghi_foto_azienda_up


Func _loghi_foto_azienda_up_load()

    _open_dialog_file_configure_loghi("Immagine Logo Azienda solo in jpg", $CONF_Input23)

EndFunc   ;==>_loghi_foto_azienda_up_load

Func _loghi_foto_bank_up()
    Local $path_bank = "'" & GUICtrlRead($CONF_Input24) & "' "
    If $path_bank = '' Then
        MsgBox(0, $GUI_Lang[49], $GUI_Lang[50])
    Else
    Local $syntax = "UPDATE ge_configurazione SET path_banca=" & $path_bank & _
            "WHERE id=0"
    _Mysql_Query($syntax)
    If @error Then
        SetError(@error, @extended, $ADO_RET_FAILURE)
    Else
        MsgBox(0, $GUI_Lang[45], $GUI_Lang[48])
    EndIf
    EndIf
EndFunc   ;==>_loghi_foto_bank_up

Func _popola_configurazione_dati()

    _Mysql_Query("SELECT * FROM ge_configurazione ")

    ; ++ show company data ++
    GUICtrlSetData($CONF_Input1, $aRecordsetContent[0][1])
    GUICtrlSetData($CONF_Input2, $aRecordsetContent[0][2])
    GUICtrlSetData($CONF_Input3, $aRecordsetContent[0][3])
    GUICtrlSetData($CONF_Input4, $aRecordsetContent[0][4])
    GUICtrlSetData($CONF_Input5, $aRecordsetContent[0][5])
    GUICtrlSetData($CONF_Input6, $aRecordsetContent[0][6])
    GUICtrlSetData($CONF_Input7, $aRecordsetContent[0][7])
    GUICtrlSetData($CONF_Input8, $aRecordsetContent[0][8])
    GUICtrlSetData($CONF_Input9, $aRecordsetContent[0][9])
    GUICtrlSetData($CONF_Input10, $aRecordsetContent[0][10])
    GUICtrlSetData($CONF_Input11, $aRecordsetContent[0][11])
    GUICtrlSetData($CONF_Input12, $aRecordsetContent[0][12])
    GUICtrlSetData($CONF_Input13, $aRecordsetContent[0][13])
    GUICtrlSetData($CONF_Input14, $aRecordsetContent[0][14])
    GUICtrlSetData($CONF_Input15, $aRecordsetContent[0][15])
    GUICtrlSetData($CONF_Input16, $aRecordsetContent[0][16])
    GUICtrlSetData($CONF_Input17, $aRecordsetContent[0][17])
    GUICtrlSetData($CONF_Input18, $aRecordsetContent[0][18])
    GUICtrlSetData($CONF_Input19, $aRecordsetContent[0][19])
    GUICtrlSetData($CONF_Input20, $aRecordsetContent[0][20])
    GUICtrlSetData($CONF_Input21, $aRecordsetContent[0][21])
    GUICtrlSetData($CONF_Input22, $aRecordsetContent[0][22])
    GUICtrlSetData($CONF_Input25, $aRecordsetContent[0][23])
    GUICtrlSetData($CONF_Input26, $aRecordsetContent[0][24])
    GUICtrlSetData($CONF_Input27, $aRecordsetContent[0][25])
    GUICtrlSetData($CONF_Input28, $aRecordsetContent[0][26])
    GUICtrlSetData($CONF_Input29, $aRecordsetContent[0][27])
    GUICtrlSetData($CONF_Input30, $aRecordsetContent[0][28])


EndFunc   ;==>_popola_configurazione_dati



Func _se_uguale_checkbox() ; passa dati da  sede operativa a sede legale

    If GUICtrlRead($CONF_Checkbox1) = $GUI_CHECKED Then
        GUICtrlSetData($CONF_Input12, GUICtrlRead($CONF_Input1))
        GUICtrlSetData($CONF_Input13, GUICtrlRead($CONF_Input2))
        GUICtrlSetData($CONF_Input14, GUICtrlRead($CONF_Input3))
        GUICtrlSetData($CONF_Input15, GUICtrlRead($CONF_Input4))
        GUICtrlSetData($CONF_Input16, GUICtrlRead($CONF_Input5))
        GUICtrlSetData($CONF_Input17, GUICtrlRead($CONF_Input6))
        GUICtrlSetData($CONF_Input18, GUICtrlRead($CONF_Input7))
        GUICtrlSetData($CONF_Input19, GUICtrlRead($CONF_Input8))
        GUICtrlSetData($CONF_Input20, GUICtrlRead($CONF_Input9))
        GUICtrlSetData($CONF_Input21, GUICtrlRead($CONF_Input10))
        GUICtrlSetData($CONF_Input22, GUICtrlRead($CONF_Input11))
        GUICtrlDelete($CONF_Button23)
        GUICtrlSetOnEvent($CONF_Button24, "_insert_double") ; inserisce la sede Legale e operativa
    Else
        GUICtrlSetData($CONF_Input12, "")
        GUICtrlSetData($CONF_Input13, "")
        GUICtrlSetData($CONF_Input14, "")
        GUICtrlSetData($CONF_Input15, "")
        GUICtrlSetData($CONF_Input16, "")
        GUICtrlSetData($CONF_Input17, "")
        GUICtrlSetData($CONF_Input18, "")
        GUICtrlSetData($CONF_Input19, "")
        GUICtrlSetData($CONF_Input20, "")
        GUICtrlSetData($CONF_Input21, "")
        GUICtrlSetData($CONF_Input22, "")
        $CONF_Button23 = GUICtrlCreateButton($GUI_Lang[12], 148, 614, 59, 21) ; Inserisci
    EndIf


EndFunc   ;==>_se_uguale_checkbox



Func _cerca_Fatt()

    _Cerca_listview($CONF_Input31, $CONF_List1)

EndFunc   ;==>_cerca_Fatt
Func _cerca_ModPAG()

    _Cerca_listview($CONF_Input32, $CONF_List2)

EndFunc   ;==>_cerca_ModPAG
Func _cerca_TypeDOC()

    _Cerca_listview($CONF_Input34, $CONF_List4)

EndFunc   ;==>_cerca_TypeDOC
Func _cerca_DDT()

    _Cerca_listview($CONF_Input33, $CONF_List3)

EndFunc   ;==>_cerca_DDT


Func _DB_Param()
    ShellExecute(@ScriptDir & "\CONFIGURE\company\DB_Account.ini")
EndFunc   ;==>_DB_Param
Func _Fatt_Doc()
    ShellExecute(@ScriptDir & "\CONFIGURE\company\motifFAT.ini")
EndFunc   ;==>_Fatt_Doc
Func _MOD_Pag()
    ShellExecute(@ScriptDir & "\CONFIGURE\company\motifTPAGA.ini")
EndFunc   ;==>_MOD_Pag
Func _Tipo_Doc()
    ShellExecute(@ScriptDir & "\CONFIGURE\company\motifCONTI.ini")
EndFunc   ;==>_Tipo_Doc
Func _Doc_DDT()
    ShellExecute(@ScriptDir & "\CONFIGURE\company\motifDDT.ini")
EndFunc   ;==>_Doc_DDT

this  a  code  

and  after is  udf 

#cs ----------------------------------------------------------------------------

    AutoIt Version: 3.3.14.2
    Author:         myName

    Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here


#include <Array.au3>
#include <MsgBoxConstants.au3>
#include <AutoItConstants.au3>
#include <WinAPIFiles.au3>

Global $StatusBar1, $oRecordset, $oConnection, $sConnectionString, $aRecordsetContent
Local Const $sFilePath = @ScriptDir & "\CONFIGURE\company\DB_Account.ini"


Global $sDriver = IniRead($sFilePath, "Azienda", "Key1", "Default Value")
Global $sDatabase = IniRead($sFilePath, "Azienda", "Key2", "Default Value")
Global $sServer = IniRead($sFilePath, "Azienda", "Key3", "Default Value")
Global $sPort = IniRead($sFilePath, "Azienda", "Key4", "Default Value")
Global $sUser = IniRead($sFilePath, "Azienda", "Key5", "Default Value")
Global $sPassword = IniRead($sFilePath, "Azienda", "Key6", "Default Value")

; Internal ADO.au3 UDF COMError Handler
_ADO_ComErrorHandler_UserFunction(_ADO_COMErrorHandler)


Func _ConnectDB_gest()

    Local $sConnectionString = 'DRIVER={' & $sDriver & '};SERVER=' & $sServer & ';PORT=' & $sPort & ';DATABASE=' & $sDatabase & ';UID=' & $sUser & ';PWD=' & $sPassword & ';'
    _GUICtrlStatusBar_SetText($StatusBar1, "Connecting DB")
    _GUICtrlStatusBar_SetIcon($StatusBar1, 0, _WinAPI_ExtractIcon($DLL_LOCATE, 82))

    $oConnection = _ADO_Connection_Create()
    _ADO_Connection_OpenConString($oConnection, $sConnectionString)
    If @error Then
        Return SetError(@error, @extended, $ADO_RET_FAILURE)
        _GUICtrlStatusBar_SetText($StatusBar1, "Offline DB")
        _GUICtrlStatusBar_SetIcon($StatusBar1, 0, _WinAPI_ExtractIcon($DLL_LOCATE, 80))
    Else

        _GUICtrlStatusBar_SetText($StatusBar1, "Online DB")
        _GUICtrlStatusBar_SetIcon($StatusBar1, 0, _WinAPI_ExtractIcon($DLL_LOCATE, 81))
    EndIf

EndFunc   ;==>_ConnectDB_gest

Func _CloseDB_gest()

    ; CleanUp
    $oRecordset = Null
    _ADO_Connection_Close($oConnection)
    $oConnection = Null

EndFunc   ;==>_CloseDB_gest

Func _Mysql_Query($sQUERY)

    ; Executing some query
    Local $oRecordset = _ADO_Execute($oConnection, $sQUERY)

    ; Get recordset to array of arrays (Conent and ColumnNames)
    $aRecordsetArray = _ADO_Recordset_ToArray($oRecordset, False)

    ; Get inner array - only conent of Recordset
    $aRecordsetContent = _ADO_RecordsetArray_GetContent($aRecordsetArray)

EndFunc   ;==>_Mysql_Query

 

Link to comment
Share on other sites

is not  compleate cod e because  is  big   

the strange is  the  ado work  correctly  put inside  the  data  in mysql 

and  after  the program  must be refresh a  modify and  display it again

but not  display again 

but  

$oConnection

is  global  and  i not  close them 

Edited by faustf
Link to comment
Share on other sites

@faustf You are using wording  which are quite difficult to understand of course in realtion to your script, and I think most of other users felt the same in relation to me , but few years ago (I hope now is much better in my case).
EDIT: but do not worry just stay active, read, write and learn AutoIt + English.

I must to go deeper in your example.
I'll back soon - I hope with solution ;)

 

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:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

Well, I hold you by the word.
You're lucky I'm a homebody.

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:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

3 hours ago, faustf said:

i dont know  why go  correctly insert  ok 

but in console  have  this  error 

###############################
ADO.au3 (600) : ==> COM Error intercepted !
$oADO_Error.description is:     Operation is not allowed when the object is closed.
$oADO_Error.windescription:     Exception occurred.

$oADO_Error.number is:  80020009
$oADO_Error.lastdllerror is:    0
$oADO_Error.scriptline is:  600
$oADO_Error.source is:  ADODB.Recordset
$oADO_Error.helpfile is:    C:\Windows\HELP\ADO270.CHM
$oADO_Error.helpcontext is:     1240653
###############################

 

Are you using latest ADO.au3 ?

 

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:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

Try this:

Func _Mysql_Query($sQUERY)

    ; Executing some query
    Local $oRecordset = _ADO_Execute($oConnection, $sQUERY)
    If @error Then
        MsgBox($MB_ICONERROR, 'SQL EXECUTE ', $sQUERY & @CRLF & @CRLF & '@error = ' & @error & @CRLF & '@extended = ' & @extended)
        Return SetError($ADO_ERR_GENERAL, $ADO_EXT_DEFAULT, $ADO_RET_FAILURE)
    EndIf

    ; Get recordset to array of arrays (Conent and ColumnNames)
    $aRecordsetArray = _ADO_Recordset_ToArray($oRecordset, False)

    ; Get inner array - only conent of Recordset
    $aRecordsetContent = _ADO_RecordsetArray_GetContent($aRecordsetArray)
    Return SetError(@error, @extended, $aRecordsetContent)
EndFunc   ;==>_Mysql_Query

 

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:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

Link to comment
Share on other sites

other  questions  @mlipok

i have  this part of  code

Func _insert_sede_Legale() ; funzione inserimento solo sede  legale

    Local $sLeg_ragion_social = "'" & GUICtrlRead($CONF_Input12) & "', "
    Local $sLeg_via = "'" & GUICtrlRead($CONF_Input13) & "', "
    Local $sLeg_citta = "'" & GUICtrlRead($CONF_Input14) & "', "
    Local $sLeg_prov = "'" & GUICtrlRead($CONF_Input15) & "', "
    Local $sLeg_mail = "'" & GUICtrlRead($CONF_Input16) & "', "
    Local $sLeg_cell = "'" & GUICtrlRead($CONF_Input17) & "', "
    Local $sLeg_piva = "'" & GUICtrlRead($CONF_Input18) & "', "
    Local $sLeg_codfi = "'" & GUICtrlRead($CONF_Input19) & "', "
    Local $sLeg_tel = "'" & GUICtrlRead($CONF_Input20) & "', "
    Local $sLeg_fax = "'" & GUICtrlRead($CONF_Input21) & "', "
    Local $sLeg_cap = "'" & GUICtrlRead($CONF_Input22) & "' "

    Local $syntax = "UPDATE ge_configurazione SET sl_ragion_social=" & $sLeg_ragion_social & _
            "sl_via=" & $sLeg_via & _
            "sl_citta=" & $sLeg_citta & _
            "sl_prov=" & $sLeg_prov & _
            "sl_mail=" & $sLeg_mail & _
            "sl_cell=" & $sLeg_cell & _
            "sl_piva=" & $sLeg_piva & _
            "sl_codfi=" & $sLeg_codfi & _
            "sl_tel=" & $sLeg_tel & _
            "sl_fax=" & $sLeg_fax & _
            "sl_cap=" & $sLeg_cap & _
            "WHERE id=0"; "WHERE id='0'"
    Local $queryde = _Mysql_Query($syntax)
    If $queryde = '' Then
        MsgBox(0, $GUI_Lang[45], $GUI_Lang[48])
        _popola_configurazione_dati()

    Else
        SetError(@error, @extended, $ADO_RET_FAILURE)

    EndIf


EndFunc   ;==>_insert_sede_Legale

but  if i  change  _mysql_Query($syntax)  for create error , work correct   return me a  error  but when  is  correct a  syntax   dont  work  msgbox and function _popola......

i tryed  also with if @error  but  have  the same  effect 

you have some idea? 

thankz alot

 

Link to comment
Share on other sites

Try this:

Func _Mysql_Query($sQUERY)

    ; Executing some query
    Local $oRecordset = _ADO_Execute($oConnection, $sQUERY)
    _ADO_ConsoleError('_Mysql_Query > Execute')
    If @error Then
        MsgBox($MB_ICONERROR, 'SQL EXECUTE ', $sQUERY & @CRLF & @CRLF & '@error = ' & @error & @CRLF & '@extended = ' & @extended)
        Return SetError($ADO_ERR_GENERAL, $ADO_EXT_DEFAULT, $ADO_RET_FAILURE)
    EndIf

    ; Get recordset to array of arrays (Conent and ColumnNames)
    $aRecordsetArray = _ADO_Recordset_ToArray($oRecordset, False)
    _ADO_ConsoleError('_Mysql_Query > _ADO_Recordset_ToArray')

    ; Get inner array - only conent of Recordset
    $aRecordsetContent = _ADO_RecordsetArray_GetContent($aRecordsetArray)
    _ADO_ConsoleError('_Mysql_Query > _ADO_RecordsetArray_GetContent')
    Return SetError(@error, @extended, $aRecordsetContent)
EndFunc   ;==>_Mysql_Query

 

but using ADO 2.1.13:)

EDIT: And of course show console output

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:

Spoiler

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. 

My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST APIErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 *

 

My contribution to others projects or UDF based on  others projects: * _sql.au3 UDF  * POP3.au3 UDF *  RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane

Useful links: * Forum Rules * Forum etiquette *  Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * 

Wiki: Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * 

OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX

IE Related:  * How to use IE.au3  UDF with  AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskSchedulerIE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related:How to get reference to PDF object embeded in IE * IE on Windows 11

I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions *  EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *

I also encourage you to check awesome @trancexx code:  * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuffOnHungApp handlerAvoid "AutoIt Error" message box in unknown errors  * HTML editor

winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/

"Homo sum; humani nil a me alienum puto" - Publius Terentius Afer
"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming"
:naughty:  :ranting:, be  :) and       \\//_.

Anticipating Errors :  "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty."

Signature last update: 2023-04-24

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
 Share

  • Recently Browsing   0 members

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