找回密码
 加入
搜索
查看: 5871|回复: 8

我想问下。。。AU3能不能操作MYSQL??

  [复制链接]
发表于 2008-6-30 17:58:58 | 显示全部楼层 |阅读模式
AU3能不能操作MYSQL,知道的提供个例子,谢谢

[ 本帖最后由 xyz161314 于 2008-7-10 03:16 编辑 ]
发表于 2008-6-30 22:29:43 | 显示全部楼层
不知道,你可以试试看啊,我这里找到一篇文章,你去看看。。。
http://www.autoitx.com/forum.php ... &extra=page%3D1
发表于 2008-6-30 23:54:08 | 显示全部楼层
安装目录下面有mysql UDF
发表于 2010-3-17 12:29:59 | 显示全部楼层
可以
发表于 2010-3-31 17:46:50 | 显示全部楼层
我也想学习下
发表于 2013-5-27 19:23:52 | 显示全部楼层
LZ上面的这个链接是个好东西
发表于 2013-5-28 00:05:51 | 显示全部楼层
不過 有個問題 必須要提醒一下  不然可能你怎麼測試都會測試不出來.....
如果你的MYSQL 是屬於  網站 網頁空間提供的.....可能你就會測試不出來了

因為 通常 網站 或者 網頁空間提供的......通常只允許 本地連接,也就是要在網路的那台主機跑
不允許 第三方 去連接的
发表于 2013-8-17 13:21:20 | 显示全部楼层
哪位大侠有教程分享一下啊
发表于 2014-7-24 01:07:49 | 显示全部楼层
函数名称:_MySQLConnect
        函数名称:_Query
        函数名称:_MySQLEnd
        函数名称:_AddRecord
        函数名称:_DeleteRecord
        函数名称:_CreateTable()
        函数名称:_CreateColumn
        函数名称:_DropCol()
        函数名称:_DropTbl()
        函数名称:_CountRecords()
        函数名称:_CountTables
        函数名称:_GetColNames
        函数名称:_GetTblNames
        函数名称:_GetColVals
        函数名称:_GetColCount
        函数名称:_GetColType



#cs


        Function Name:    _MySQLConnect
        函数名称:_MySQLConnect

        Description:      Initiate a connection to a MySQL database.
        说明:启动一个连接到MySQL数据库。

        Parameter(s):     $username - The username to connect to the database with.
        参数(补):$用户名 - 连接到的用户名与数据库。

        $password - The password to connect to the database with. $Database - Database to connect to.
        $密码 - 密码与连接到数据库。 $数据库 - 要连接的数据库。

        $server - The server your database is on.
        $服务器 - 数据库服务器上。

        $driver (optional) the ODBC driver to use (default is "{MySQL ODBC 3.51 Driver}"
        $驱动器(可选)的ODBC驱动程序使用(默认为“{}的MySQL的ODBC驱动程序3.51”

        Requirement(s):   Autoit 3 with COM support
        要求(补):AutoIt的3 COM支持

        Return Value(s):  On success returns the connection object for subsequent functions. On failure returns 0 and sets @error
        返回值(S):成功返回后续函数连接对象。失败时返回0,并设置@错误

        @Error = 1
        @错误= 1

        Error opening connection
        错误打开连接

        @Error = 2
        @错误= 2

        MySQL ODBC Driver not installed.
        MySQL的ODBC驱动程序没有安装。

        Author(s):        cdkid
        作者(s):cdkid

        说明:需要安装MYsql的ODBC驱动,下载地址:
        说明:需要安装Mysql的ODBC的驱动的,下载地址:

        [url]http://dev.mysql.com/downloads/connector/odbc/3.51.html[/url]
        [url]http://dev.mysql.com/downloads/connector/odbc/3.51.html[/url]

#ce


#cs


        Function name: _Query
        函数名称:_Query

        Description:     Send a query to the database
        说明:发送一个查询到数据库

        Parameter(s):  $oConnectionObj - As returned by _MySQLConnect. $query - The query to execute
        参数(补):$ oConnectionObj - 由_MySQLConnect返回。 $查询 - 查询,以执行

        Return Value(s):On success returns the query result. On failure returns 0 and sets @error to 1
        返回值(S):成功返回查询结果。失败时返回0,并设置@错误1

        Requirement(s):Autoit3 with COM support
        要求(补):Autoit3与COM支持

        Author(s):        cdid
        作者(s):cdid

#ce


#cs


        Function name: _MySQLEnd
        函数名称:_MySQLEnd

        Description:      Closes the database connection (see notes)
        说明:关闭数据库连接(见说明!)

        Parameter(s):   $oConnectionObj - The connection object as returned by _MySQLConnect()
        参数(补):$ oConnectionObj - 连接对象返回_MySQLConnect()

        Requirement(s):Autoit 3 with COM support
        要求(补):AutoIt的3 COM支持

        Return Value(s):On success returns 1. On failure returns 0 and sets @error to 1
        返回值(S):成功返回1。失败时返回0,并设置@错误1

        Author(s):         cdkid
        作者(s):cdkid

#ce


#cs


        Function name: _AddRecord
        函数名称:_AddRecord

        Description:     Adds a record to the specified table
        说明:添加一条记录到指定的表

        Note(s):           to add to multiple columns use an array with one blank element at the end as the $sColumn, and $value parameter
        注(补):添加到多个列使用与$ sColumn结束与一个空白的元素的数组,$值参数

        Parameter(s):   $oConnectionObj - As returned by _MySQL Connect. $sTable - The table to put the record in
        参数(补):$ oConnectionObj - 由_MySQL返回连接。 $稳定 - 该表将记录在

                        $row - The row to put the record in. $value - The value to put into the row
        $行 - 该行把英寸$值的记录 - 该值放入行

                                        $vValue - OPTIONAL default will be default for the column (will not work with array, see notes)
        $架构与时代价值 - 可选预设将列的默认(不会与数组,见注)

        Requirement(s): Autoit 3 with COM support
        要求(补):AutoIt的3 COM支持

        Return value(s): On success returns 1. If the connectionobj is not an object returns 0 and sets @error to 2. If there is any other error returns 0 and sets @error to 1.
        返回值(S):成功返回1。如果connectionobj不是一个对象返回0,并设置@误差为2。如果有任何其他错误返回0,并设置@误差为1。

        Author(s): cdkid, burthold (fixed a problem with extra commas)
        作者(s):cdkid,burthold(修正了一个额外的逗号的问题)

#ce


#cs


        Function name: _DeleteRecord
        函数名称:_DeleteRecord

        Description:     Deletes a record from the specified table
        说明:删除一条记录从指定的表

        Parameter(s):  $oConnectionObj - As returned by _MySQLConnect. $sTable - The table to delete from.
        参数(补):$ oConnectionObj - 由_MySQLConnect返回。 $稳定 - 该表删除。

        $sColumn - The column to check value (see the example in the next post) $vRecordVal -
        $ sColumn - 列检查值(参见下一个帖子的例子)$ vRecordVal -

        The value to check in $sColumn (see example).
        检查的价值在$ sColumn(见示例)。

        $iLimit (optional) - the max number of record to delete if multiple match the criteria (default 1)
        $ iLimit(可选) - 最大数量的记录中删除,如果多个匹配的标准(默认1)

        Return Value(s): On success returns 1. If there $oConnectionObj is not an object returns 0 and sets @error to 1. If there are any other errors returns 0 and sets @error to 2
        返回值(S):成功返回1。如果有$ oConnectionObj不是一个对象返回0,并设置@错误1。如果有任何其他错误返回0,并设置@误差为2

        Requirement(s): Autoit 3 with COM support
        要求(补):AutoIt的3 COM支持

#ce


#cs


        Function name: _CreateTable()
        函数名称:_CreateTable()

        Description: Creates a table
        说明:创建一个表

        Parameters: $oConnectionObj - as returned by _MySQLConnect, $sTbl - The name of the table to create, $sPrimeKey - The name of the
        参数:$ oConnectionObj - 由_MySQLConnect返回,$ sTbl - 表的名称来创建,$ sPrimeKey - 该名称

        primary key column. $keytype - The datatype of the primary key (default is integer), $sNotNull - "yes" = must be filled out whenever
        主键列。 $ keytype - 以主键的数据类型(默认为整数),$ sNotNull - “是”=时必须填写

        a record is added "no" does not need to be filled out ("yes" default). $keyautoinc - "yes" = Auto incrememnts "no" = does not.
        记录是添加了“不”并不需要填写(“是”默认)。 $ keyautoinc - “是”=自动incrememnts“不”=没有。

        $sType - The table type (default is InnoDB)
        $ sType - 表类型(默认为InnoDB的)

        Requirements: Autoit V3 with COM support
        要求:AutoIt的V3的支持与COM

        Return value(s): on success returns 1 on failure sets @error to 1 and returns 0
        返回值(S):成功返回1,失败设置@误差为1,返回0

        Author: cdkid
        作者:cdkid

#ce


#cs


        Function Name: _CreateColumn
        函数名称:_CreateColumn

        Description: Creates a column in the given table
        说明:创建一个在给定的表列

        Requirements: AutoitV3 with COM support
        要求:AutoitV3与COM支持

        Parameters: $oConnectionObj - as returned by _MySQLConnect. $sTable - the name of the table to add the column to.
        参数:$ oConnectionObj - 由_MySQLConnect返回。 $稳定 - 表的名称来添加列。

        $sAllowNull - if 'yes' then does not add 'NOT NULL' to the SQL statement (default 'yes') $sDataType - The data type of the column
        $ sAllowNull - 如果'是',那么不加'非空'的SQL语句(缺省为'是')$ sDataType - 列的数据类型

        default('VARCHAR(45)').         $sAutoInc - if 'yes' adds 'AUTO_INCREMENT' to the MySQL Statement (for use with Integer types)
        默认('为varchar(45)')。 $ sAutoInc - 如果'是'补充'的AUTO_INCREMENT'到MySQL声明(与整数类型的使用)

        default('no').          $sUnsigned - if 'yes' adds 'UNSIGNED' to the MySQL statement. default('no') $vDefault - the default value of the column
        默认('不')。 $ sUnsigned - 如果'是'添加'无符号'到MySQL语句。默认('不')$ vDefault - 列的默认值

        default('')
        默认('')

        Author: cdkid
        作者:cdkid

#ce


#cs


        Function Name: _DropCol()
        函数名称:_DropCol()

        Description: Delete a column from the given table
        说明:删除一列从给定的表

        Requirements: AutoitV3 with COM support
        要求:AutoitV3与COM支持

        Parameters: $oConnectionObj - As returned by _MySQLConnect(). $sTable - The name of the table to delete the column from
        参数:$ oConnectionObj - 由_MySQLConnect()返回。 $稳定 - 该表的名称删除列从

        $sColumn - THe name of the column to delete
        $ sColumn - 列的名称删除

        Author: cdkid
        作者:cdkid

#ce


#cs


        Function Name: _DropTbl()
        函数名称:_DropTbl()

        Description: Deletes a table from the database
        说明:从数据库中删除表

        Requirements: AutoitV3 with COM support
        要求:AutoitV3与COM支持

        Parameters: $oConnectionObj - As returned by _MySQLConnect. $sTable - The name of the table to delete
        参数:$ oConnectionObj - 由_MySQLConnect返回。 $稳定 - 该表的名称删除

        Author: cdkid
        作者:cdkid

#ce


#cs


        Function name: _CountRecords()
        函数名称:_CountRecords()

        Description: Get the number of records in the specified column
        说明:获取指定列中的记录数

        Parameters: $oConnectionObj - As returned by _MySQLConnect. $sTable - The name of the table that the column is in
        参数:$ oConnectionObj - 由_MySQLConnect返回。 $稳定 - 表的名称列在

        $value - If not = "" then it is put in the select statement in the WHERE clause (default "")
        $值 - 如果不=“”那么它放在WHERE子句(SELECT语句中的默认“”)

        Return value(s): On success returns the number of records. On failure sets @error to 1 and returns 0
        返回值(S):成功返回的记录数。如果失败设置@误差为1,返回0

        Author: cdkid
        作者:cdkid

#ce


#cs


        Function name: _CountTables
        函数名称:_CountTables

        Description: Counts the number of tables in the database
        描述:计数的表在数据库中数

        Parameter(s): $oConnectionObj - As returned by _MySQLConnect
        参数(补):$ oConnectionObj - 由_MySQLConnect返回

        Return value(s): if error - returns 0 and sets @error to 1. on success returns the number of tables in the database
        返回值(S):如果错误 - 返回0,并设置@误差为1。成功返回数字在数据库中的表

        Author: cdkid
        作者:cdkid

#ce


#cs


        Function name: _GetColNames
        函数名称:_GetColNames

        Description: Get's the names of all columns in a specified table
        描述:获取在一个指定表的所有列的名称

        Parameters: $oConnectionObj - As returned by _MySQLConnect. $sTable - The name of the table to get the column names from
        参数:$ oConnectionObj - 由_MySQLConnect返回。 $稳定 - 该表的名称以获得列名从

        Return values: On success returns an array where $array[0] is the number of elements in the array and all the rest are column names.
        返回值:成功返回一个数组,其中数组$ [0]是数组中的元素个数和所有其余的列名。

        On failure returns 0 and sets @error to 1
        失败时返回0,并设置@错误1

        Author: cdkid
        作者:cdkid

#ce


#cs


        Function name: _GetTblNames
        函数名称:_GetTblNames

        Description: Gets the names of all tables in the database
        说明:获取数据库中所有表的名称

        Parameters: $oConnectionObj - As returned by _MySQLConnect
        参数:$ oConnectionObj - 由_MySQLConnect返回

        Return value(s): On success returns an array where $array[0] is the number of tables and $array[n] is the nth table's name
        返回值(S):成功返回一个数组,其中数组$ [0]是数组的表的数量和$ [n]是第n个表的名称

        on failure - returns 0 and sets @error to 1
        失败 - 返回0和1套@错误

        Author: cdkid
        作者:cdkid

#ce


#cs


        Function name: _GetColVals
        函数名称:_GetColVals

        Description: Gets all of the values of a specified column in a specified table
        说明:获取指定表中的指定列的所有值

        Parameters: $oConnectionObj - As returned by _MySQLConnect(), $sTable - the table that the column is in
        参数:$ oConnectionObj - 作为返回_MySQLConnect(),$稳定 - 表中的列

        $sColumn - the column to get values from.
        $ sColumn - 列得到的值是从。

        Return value(s): On success returns an array where $array[0] is the number of values and $array[n] is the Nth value
        返回值(S):成功返回一个数组,其中数组$ [0]是数组的值的数量和$ [n]是第N个值

        On failure sets @error to 1 and returns 0
        如果失败设置@误差为1,返回0

        Author: cdkid
        作者:cdkid

#ce


#cs


        Function name: _GetColCount
        函数名称:_GetColCount

        Description: Gets the number of columns in the specified table
        说明:获取指定表中的列数

        Parameters: $oConnectionObj - As returned by _MySQLConnect(). $sTable - the table to count the columns in
        参数:$ oConnectionObj - 由_MySQLConnect()返回。 $稳定 - 表中的列数

        Return Value(s): On success returns the number of columns in the table. On failure returns -1 and sets @error to 1
        返回值(S):成功返回表中的列数。如果失败返回-1并设置错误1 @

        Author: cdkid
        作者:cdkid

#ce


#cs


        Function name: _GetColType
        函数名称:_GetColType

        Description: Gets the DATA TYPE of the specified column
        说明:获取指定列的数据类型

        Parameters: $oConnectionObj - As returned by _MySQLConnect(). $sTable - the table that the column is in. $sColumn - the column
        参数:$ oConnectionObj - 由_MySQLConnect()返回。 $稳定 - 该列所在$ sColumn表 - 列

        to retrieve the data type from.
        以检索数据类型。

        Return value(s): On success returns the data type of the column. On failure returns 0 and sets @error to 1
        返回值(S):成功返回列的数据类型。失败时返回0,并设置@错误1

        Author: cdkid
        作者:cdkid

#ce


#cs


        Function: _GetDBNames
        功能:_GetDBNames

        Description: Get a count and list of all databases on current server.
        描述:获取当前服务器上所有数据库的数量和名单。

        Parameters: $oConObj - As returned by _MySQLConnect
        参数:$ oConObj - 由_MySQLConnect返回

        Return Value(s): Success - An array where $array[0] is the number of databases and $array[n] is the nth database name.
        返回值(S):成功 - 一个数组,其中$数组[0]是数组的数据库和$ [n]的数量是n次数据库的名称。

        Failure - -1 and sets @error to 1
        失败 - -1并设置错误1 @

        Author: cdkid
        作者:cdkid

#ce


#cs


        Function: _ChangeCon
        功能:_ChangeCon

        Description: Change your connection string
        说明:更改连接字符串

        Parameters:
        参数:

        $oConnectionObj
        $ oConnectionObj

        As returned by _MySQLConnect
        由于返回_MySQLConnect

        $username
        $的用户名

        OPTIONAL: the new username to use
        选购:新使用的用户名

        If omitted, the same username will be used.
        如果省略,将使用相同的用户名。

        $password
        $密码

        OPTIONAL: the new password to use
        选购:新的密码才能使用

        If omitted, the same password will be used.
        如果省略,将使用相同的密码。

        $database
        $数据库

        OPTIONAL: the new database to connect to
        选购:新的数据库连接

        If omitted, the same database will be used.
        如果省略,将使用相同的数据库。

        $driver
        $司机

        OPTIONAL: the new driver to use
        选购:要使用新的驱动程序

        If omitted, the MySQL ODBC 3.51 DRIVER will be used.
        如果省略,则MySQL的ODBC 3.51驱动程序将被使用。

        $server
        $服务器

        OPTIONAL: the new server to connect to
        选购:新的服务器连接到

        If omitted, the same server will be used.
        如果省略,将使用相同的服务器。

        Return Value:
        返回值:

        On success, a new connection object for use with subsequent functions.
        如果成功,为以后的使用功能和新的连接对象。

        On failure, -1 and sets @error to 1
        如果失败,-1并设置错误1 @

        Author: cdkid
        作者:cdkid

#ce
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-9-28 04:23 , Processed in 0.076992 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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