找回密码
 加入
搜索
查看: 2220|回复: 3

[AU3基础] mysql脚本报错

[复制链接]
发表于 2014-1-13 14:49:04 | 显示全部楼层 |阅读模式
本帖最后由 liangxm 于 2014-1-13 17:12 编辑

在测试mysql脚本,发现好像没有mysql.au3,一堆报错,下了最新的AUTOIT_SVN R1003,发现include里面也没有,有没有哪位有的,给我一发,3q~


#include "mysql.au3"
#include <Array.au3>

__MySQL_ExtractEmbeddedDLL()
_MySQL_InitLibrary()
If @error Then Exit MsgBox(0, '', "could not init MySQL")
Global $MysqlConn = _MySQL_Init()
Database()
_MySQL_Close($MysqlConn)
_MySQL_EndLibrary()

Func DATABASE()
        $Pass = "andrew"
        $connected = _MySQL_Real_Connect($MysqlConn, "10.2.49.70", "root", $Pass)
        If $connected = 0 Then
                $errno = _MySQL_errno($MysqlConn)
                MsgBox(0, "Error:", $errno & @LF & _MySQL_error($MysqlConn))
                If $errno = $CR_UNKNOWN_HOST Then MsgBox(0, "Error:", "$CR_UNKNOWN_HOST" & @LF & $CR_UNKNOWN_HOST)
                _MySQL_Close($MysqlConn)
                _MySQL_EndLibrary()
                Exit
        EndIf


error: $CR_UNKNOWN_HOST: 未声明的全局变量.
warning: $MYSQL_SUCCESS: 使用前并未进行声明.
error: __MySQL_ExtractEmbeddedDLL(): 未定义的函数.
 楼主| 发表于 2014-1-13 16:03:35 | 显示全部楼层
本帖最后由 liangxm 于 2014-1-13 16:21 编辑

发现UserInclude下有文件。。。
不知道
__MySQL_ExtractEmbeddedDLL()
_MySQL_InitLibrary()
这些在哪呢?还是在报错
odbc也装了
 楼主| 发表于 2014-1-14 10:05:12 | 显示全部楼层
我找到了一份貌似ok的MySQL.au3,那些方法都基本有了,为啥include进去了还是报一个错?
#include <MySQL.au3>
#include <Array.au3>
#include <libMySQLdll.au3>


Local $vElement = 0, $iDim_1 = UBound($avArray, 1), $iDim_2 = UBound($avArray, 2), $iDim_Max = ($iDim_1 > $iDim_2) ? $iDim_1 : $iDim_2
Local $vElement = 0, $iDim_1 = UBound($avArray, 1), $iDim_2 = UBound($avArray, 2), $iDim_Max = ($iDim_1 > $iDim_2) ^ ERROR


自带的Array.au3有问题吗?
 楼主| 发表于 2014-1-14 10:16:42 | 显示全部楼层
把Array.au3改了一下好了

Local $vElement = 0, $iDim_1 = UBound($avArray, 1), $iDim_2 = UBound($avArray, 2), $iDim_Max

        If $iDim_1 > $iDim_2 Then
                $iDim_Max = $iDim_1
        Else
                $iDim_Max = $iDim_2
        EndIf
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-17 13:23 , Processed in 0.078564 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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