djzero 发表于 2010-3-4 18:04:30

Mysql写入出错

出错返回值是1
帮忙解决        _MySQL_InitLibrary()
        If @error Then Exit MsgBox(0, '提示', "程序出错!",-1,$Main)
        $MysqlConn = _MySQL_Init()
        $connected = _MySQL_Real_Connect($MysqlConn,$Server,$User,$Pwd,$Database,$Port)
        If $connected = 0 Then
                $errno = _MySQL_errno($MysqlConn)
                MsgBox(0,"出错:",$errno & @LF & _MySQL_error($MysqlConn))
                If $errno = $CR_UNKNOWN_HOST Then MsgBox(0,"出错:","$CR_UNKNOWN_HOST" & @LF & $CR_UNKNOWN_HOST,-1,$Main)
        Endif
        $M_Name_Tem="AUTOIT CN"
        $M_Singer_Tep="作者"
        $ADDPath="地址"
        $FAddSQL="insert into musicitem (m_name,m_singer,m_location)Values ('"&$M_Name_Tem&"','"&$M_Singer_Tep&"','"&$ADDPath&"')"
        _MySQL_Query($MysqlConn, "set names gbk")
        Local $MRQ=_MySQL_Real_Query($MysqlConn,$FAddSQL)
        If $MRQ<> 0 Then
                MsgBox(0,"提示","保存"&$M_Name_Tem&"出错!"&@CRLF&"出错代号:"&$MRQ,-1,$Main)
                Return -1
        EndIf

auto 发表于 2010-3-4 19:30:11

在www.autoitscript.comMYSQL的UDF,测试了一下,英文没什么问题,好像不支持中文

djzero 发表于 2010-3-5 21:44:55

:face (9):不支持中文:face (36):
:face (2):
页: [1]
查看完整版本: Mysql写入出错