Jump to content
Sign in to follow this  
faustf

mysql problem

Recommended Posts

faustf

hi  guy i  have  a  little problem  with mysql when i try to insert  , i have  this  error

 Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
C:UsersstefanoDocumentsprogrammazione_GESTIONALE_WEBautoitMySQL.au3 (132) : ==> The requested action with this object has failed.:
$oconnectionobj.execute ($query)
$oconnectionobj.execute ($query)^ ERROR
->01:16:15 AutoIt3.exe ended.rc:1
>Exit code: 1    Time: 21.848
 

Func  _magazzino()
    GUIDelete("GEST")

    $Form1_1_1 = GUICreate("GEST", 1074, 661, 487, 101, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_TABSTOP))

    _MenuFile()

$Button2 = GUICtrlCreateButton("Scansione", 952, 32, 75, 21, $BS_NOTIFY)
$Button3 = GUICtrlCreateButton("<--- Importa ---", 952, 176, 75, 21, $BS_NOTIFY)
$corpo=GUICtrlCreateEdit(" Codice \ Descrizione \ Quantità \ Prezzo\", 21, 61, 913, 545, $GUI_SS_DEFAULT_EDIT)
$Label12 = GUICtrlCreateLabel("Sintassi Separazioni :      Codice \ Descrizione \ Quantità \ Prezzo\ ", 22, 32, 401, 17, 0)

GUICtrlSetOnEvent($Button3, "_importa")
EndFunc
Global $z ,$string[99]

Func _importa()
$corpofat=GUICtrlRead($corpo)
Global $k=1
$string = StringSplit($corpofat, "\") ;Crea un array con le lettere, ogni volta che c' è \ creo un dato
    Local $i= ($string[0])/4

    $verifica = $string[0]
    local $x=($verifica-1)

    For $verifica=1 To $x


    _inserimento()
    ;MsgBox(0,'',$string[$k])

    $k=$k+2
    Next

EndFunc


func _inserimento()

$baseprice=$pricelist_1_baseprice=$pricelist_2_baseprice

    Dim $TableName = "dynarc_gmart_items"
    Dim $ColumnNames[62]
    Dim $NewGuest[62]


;   $ColumnNames[0] = "id"
    $ColumnNames[0] = "uid"
    $ColumnNames[1] = "gid"
    $ColumnNames[2] = "_mod"
    $ColumnNames[3] = "cat_id"
    $ColumnNames[4] = "lnk_id"
    $ColumnNames[5] = "lnkarc_id"
    $ColumnNames[6] = "name"
    $ColumnNames[7] = "description"
    $ColumnNames[8] = "keywords"
    $ColumnNames[9] = "ordering"
    $ColumnNames[10] = "trash"
    $ColumnNames[11] = "ctime"
    $ColumnNames[12] = "mtime"
    $ColumnNames[13] = "published"
    $ColumnNames[14] = "hierarchy"
    $ColumnNames[15] = "brand"
    $ColumnNames[16] = "brand_id"
    $ColumnNames[17] = "model"
    $ColumnNames[18] = "barcode"
    $ColumnNames[19] = "manufacturer_code"
    $ColumnNames[20] = "qty_sold"
    $ColumnNames[21] = "units"
    $ColumnNames[22] = "aliasname"
    $ColumnNames[23] = "code_num"
    $ColumnNames[24] = "code_str"
    $ColumnNames[25] = "code_ext"
    $ColumnNames[26] = "md5"
    $ColumnNames[27] = "baseprice"
    $ColumnNames[28] = "vat"
    $ColumnNames[29] = "pricelist_1_baseprice"
    $ColumnNames[30] = "pricelist_1_marate"
    $ColumnNames[31] = "pricelist_1_vat"
    $ColumnNames[32] = "pricelist_2_baseprice"
    $ColumnNames[33] = "pricelist_2_marate"
    $ColumnNames[34] = "pricelist_2_vat"
    $ColumnNames[35] = "storeqty"
    $ColumnNames[36] = "booked"
    $ColumnNames[37] = "incoming"
    $ColumnNames[38] = "loaded"
    $ColumnNames[39] = "downloaded"
    $ColumnNames[40] = "thumb_img"
    $ColumnNames[41] = "thumb_img_2"
    $ColumnNames[42] = "thumb_img_3"
    $ColumnNames[43] = "thumb_img_4"
    $ColumnNames[44] = "thumb_img_5"
    $ColumnNames[45] = "thumb_img_6"
    $ColumnNames[46] = "idocs"
    $ColumnNames[47] = "store_1_qty"
    $ColumnNames[48] = "store_2_qty"
    $ColumnNames[49] = "store_3_qty"
    $ColumnNames[50] = "store_4_qty"
    $ColumnNames[51] = "pricelist"
    $ColumnNames[52] = "weight"
    $ColumnNames[53] = "weightunits"
    $ColumnNames[54] = "item_location"
    $ColumnNames[55] = "pricelist_1_vendorprice"
    $ColumnNames[56] = "pricelist_1_cm"
    $ColumnNames[57] = "pricelist_1_discount"
    $ColumnNames[58] = "pricelist_2_vendorprice"
    $ColumnNames[59] = "pricelist_2_cm"
    $ColumnNames[60] = "pricelist_2_discount"
    $ColumnNames[61] = ""



    ;$NewGuest[0] = $id
    $NewGuest[0] = $uid
    $NewGuest[1] = $gid
    $NewGuest[2] = $_mod
    $NewGuest[3] = $cat_id
    $NewGuest[4] = $lnk_id
    $NewGuest[5] = $lnkarc_id

$k=$k+1
    $NewGuest[6] = '- '&$string[$k] ;$name

    $NewGuest[7] = $string[$k] ;$description

    $NewGuest[8] = $keywords
    $NewGuest[9] = $ordering
    $NewGuest[10] = $trash

    $NewGuest[11] = $ctime
    $NewGuest[12] = $mtime

    $NewGuest[13] = $published
    $NewGuest[14] = $hierarchy

    $NewGuest[15] = '- ' ;$brand

    $NewGuest[16] = $brand_id
    $NewGuest[17] =  $string[$k] ; $model

    $NewGuest[18] = $barcode
    $NewGuest[19] = $manufacturer_code
    $NewGuest[20] = $qty_sold
    $NewGuest[21] = $units
    $NewGuest[22] = $aliasname
    $NewGuest[23] = $code_num

    $k=$k-1
    $NewGuest[24] = $string[$k];$code_str

    $NewGuest[25] = $code_ext
    $NewGuest[26] = $md5

    $k=$k+3
    $NewGuest[27] = $string[$k] ; $baseprice

    $NewGuest[28] = $vat

    $NewGuest[29] = $string[$k] ;$pricelist_1_baseprice

    $NewGuest[30] = $pricelist_1_marate
    $NewGuest[31] = $pricelist_1_vat

    $NewGuest[32] = $string[$k] ;$pricelist_2_baseprice
    $NewGuest[33] = $pricelist_2_marate

    $NewGuest[34] = $pricelist_2_vat

    $k=$k-1
    $NewGuest[35] = $string[$k] ;$storeqty

    $NewGuest[36] = $booked
    $NewGuest[37] = $incoming
    $NewGuest[38] = $loaded
    $NewGuest[39] = $downloaded
    $NewGuest[40] = $thumb_img
    $NewGuest[41] = $thumb_img_2
    $NewGuest[42] = $thumb_img_3
    $NewGuest[43] = $thumb_img_4
    $NewGuest[44] = $thumb_img_5
    $NewGuest[45] = $thumb_img_6
    $NewGuest[46] = $idocs
    $NewGuest[47] = $store_1_qty
    $NewGuest[48] = $store_2_qty
    $NewGuest[49] = $store_3_qty
    $NewGuest[50] = $store_4_qty
    $NewGuest[51] = $pricelist
    $NewGuest[52] = $weight
    $NewGuest[53] = $weightunits
    $NewGuest[54] = $item_location
    $NewGuest[55] = $pricelist_1_vendorprice
    $NewGuest[56] = $pricelist_1_cm
    $NewGuest[57] = $pricelist_1_discount
    $NewGuest[58] = $pricelist_2_vendorprice
    $NewGuest[59] = $pricelist_2_cm
    $NewGuest[60] = $pricelist_2_discount
    $NewGuest[61] = ""


    $SQLInstance = _MySQLConnect($UserName, $Password, $Database, $MySQLServerName)
    _AddRecord($SQLInstance, $TableName, $ColumnNames, $NewGuest)
    _MySQLEnd($SQLInstance)


endfunc

Share this post


Link to post
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
Sign in to follow this  

×