找回密码
 加入
搜索
查看: 2733|回复: 2

[AU3基础] Mysql写入出错

[复制链接]
发表于 2010-3-4 18:04:30 | 显示全部楼层 |阅读模式
出错返回值是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
发表于 2010-3-4 19:30:11 | 显示全部楼层
www.autoitscript.comMYSQL的UDF,测试了一下,英文没什么问题,好像不支持中文
 楼主| 发表于 2010-3-5 21:44:55 | 显示全部楼层
不支持中文
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-20 12:02 , Processed in 0.074456 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表