Quote
Filename: MySQL.au3
Description: A collection of functions for interacting with MySQL
Author: cdkid <cdkid@team-kan.com>
Version: 1.6
Requirements: Autoit V3 with COM support.
Note: Make sure to add _MySQLEnd to the end of any script you use this with or you will have open connections to your DB left open!!!!
Note2: at the end of your script i find that it helps to turn your connection object (in the examples i use $sql) to "" so add $sql = "" to the end
Note3: I think it is because using COM from a non-server connecting to a DB on a server, but these can take an EXTREMELY long time.
---> functions:
_MySQLConnect()
Open a connection to the specified Database
_MySQLEnd()
Close the connection (read notes!)
_AddRecord()
Adds a record to a specified table
_DeleteRecord()
Deletes a record from the specifed table.
_Query()
Execute a query to the database
_CreateTable()
Adds a table to the database
_CreateColumn()
Adds a column to the given table
_DropCol()
Deletes a column from the given table
_DropTbl()
Deletes a table from the given DB
_CountRecords()
Counts the number of records in the given column
_CountTables()
Counts the number of tables in the database
_GetColNames()
Gets the names of all the columns in the given table
_GetTblNames()
Gets the names of all the tables in the database
_GetColvals()
Gets all of the values of the specified column
_GetColType()
Gets the DATA TYPE of the specified column
_GetColCount()
Gets a count of all columns in the specified table
_MySQLTableExists()
Find out whether or not a specified table exists
_GetDBNames()
Get a list & count of databases on the current server.
_ChangeCon()
Change your connection string.
Todo:
any input would be much appreciated! i hope this helps someone
The MySQL ODBC 3.51 DRIVER IS REQUIRED FOR THIS
it can be downloaded here: http://dev.mysql.com/downloads/connector/odbc/3.51.html
Quote
1/27/06 2:27 PM - Added _CreateTable
1/27/06 4:43 PM - Added _CreateColumn
1/27/06 5:14 PM - Added _DropCol and _DropTbl
1/28/06 2:01 PM - Added _CountRecords
1/28/06 10:02 PM - Added _CountTables
1/29/06 3:34 PM - Added _GetColNames
1/30/06 11:26 AM - Added _GetTblNames
2/06/06 12:29 PM - Added _GetColVals
2/08/06 8:24 PM - Added _GetColCount and _GetColType
2/21/06 10:17 PM - Added _MySQLTable exists, and am in process of updating these for submitting to the Standard UDF Library.
3/09/06 10:27 AM - Added _GetDBNames
3/09/06 5:29 PM - Added _ChangeCon
3/17/06 12:39 PM - Updated _MySQLConnect to set @Error to 2 if the MySQL ODBC Driver is not installed.
8/30/06 7:56 PM - Fixed a problem with _AddRecord (Thanks burthold)\
7/31/07 1:51 PM - Updated _MySQLConnect and _ChangeCon to allow a user specified port
Downloads:
v1.6 - 1964
v1.5 - 756
v1.4 - 60
v1.3 - 150
Below is a .ZIP called "ODBC_DRIVER_SETUP" it has the au3 for driver setup, read _ReadMe_.txt to see how to make it work.
Attached File(s)
-
mysql.au3 (18.99K)
Number of downloads: 6498 -
ODBC_DRIVER_SETUP.zip (771bytes)
Number of downloads: 4910
This post has been edited by cdkid: 31 July 2007 - 08:01 PM

Sign In
Register
Help


MultiQuote