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

[AU3基础] Mysql写入出错

[复制链接]
发表于 2010-3-4 18:04:30 | 显示全部楼层 |阅读模式
出错返回值是1
帮忙解决
  1.         _MySQL_InitLibrary()
  2.         If @error Then Exit MsgBox(0, '提示', "程序出错!",-1,$Main)
  3.         $MysqlConn = _MySQL_Init()
  4.         $connected = _MySQL_Real_Connect($MysqlConn,$Server,$User,$Pwd,$Database,$Port)
  5.         If $connected = 0 Then
  6.                 $errno = _MySQL_errno($MysqlConn)
  7.                 MsgBox(0,"出错:",$errno & @LF & _MySQL_error($MysqlConn))
  8.                 If $errno = $CR_UNKNOWN_HOST Then MsgBox(0,"出错:","$CR_UNKNOWN_HOST" & @LF & $CR_UNKNOWN_HOST,-1,$Main)
  9.         Endif
  10.         $M_Name_Tem="AUTOIT CN"
  11.         $M_Singer_Tep="作者"
  12.         $ADDPath="地址"
  13.         $FAddSQL="insert into musicitem (m_name,m_singer,m_location)Values ('"&$M_Name_Tem&"','"&$M_Singer_Tep&"','"&$ADDPath&"')"
  14.         _MySQL_Query($MysqlConn, "set names gbk")
  15.         Local $MRQ=_MySQL_Real_Query($MysqlConn,$FAddSQL)
  16.         If $MRQ<> 0 Then
  17.                 MsgBox(0,"提示","保存"&$M_Name_Tem&"出错!"&@CRLF&"出错代号:"&$MRQ,-1,$Main)
  18.                 Return -1
  19.         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, 2026-9-22 09:50 , Processed in 0.059618 second(s), 22 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2026 Discuz! Team.

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