Sign in to follow this  
Followers 0
BigDaddyO

MySQL with AutoIT

11 posts in this topic

Well, I just spent the last 8 hours trying to figure out mySQL. I managed to install it and create a new table and columns but when trying to connect to the database with AutoIT I can't seem to get it to work. Could be that I just don't quite have the knowledge to figure it out on my own. There is very little info on the web that deals with connecting to mySQL with VBScript "Only thing I understand enought to convert to AutoIT". There is a lot of php but I can't figure it out enough to convert it to AutoIT.

I found a VB 6 database connection string from one site that I converted to AutoIT

$mysqlCon = ObjCreate("ADODB.Connection")
$mysqlCon.Open("Provider=MySqlProv;Data Source=\\127.0.0.1\Patches")
but that always errors out.

on the mySQL web site I can't find any refrence to Provider= it just talks about Driver= which would mean I would have to install the myODBC drivers on each of the machines I want to send data from. I REALLY don't want to install those drivers. Has anyone got any ideas.

Thanks,

Mike


Share this post


Link to post
Share on other sites



You should be able to create ODBC connections to remote systems. That way you only have to set it up on one system...


Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites

Check out the following link:

MYSQL ODBC Connector


We have enough youth. How about a fountain of SMART?

Share this post


Link to post
Share on other sites

get mysql, the admin tool, the query browser, and the odbc driver.

install and test configuration w/ the mysql tools. create your database using the admin tool, then set up the odbc driver to autoconnect to that database, using the correct username/password - then your code will only have to utilize the DSN, a la

Global $ado = ObjCreate( "ADODB.Connection" )
             $ado.Open( "DSN=mlb_standings" )

will create the $ado object. I have attached a screenshot of the relevant DSN property page. there are a number of topics that discuss table creation and select operations - fewer on inserts. I am sure that soon someone w/ ample time and interest will write a slew of wrapper UDFs for SQL inserts and queries, using both the Execute and Recordset methods.


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

Just dont forget to create the DSN from the Admin Settings from the Control Panel.

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

You should be able to create ODBC connections to remote systems.  That way you only have to set it up on one system...

<{POST_SNAPBACK}>

MSlx Fanboy,

Could you elaborate on this? :) This sound like what I need to do, since I don't want to be installing the myODBC drivers on each of the computers. Could I install the myODBC drivers on the same comptuer that the mySQL is running on and remotely use those drivers?

Thanks,

Mike


Share this post


Link to post
Share on other sites

:D:D:)

I give up. I have been frying my brain for two solid days on this and I have gotten no where.

On my Test PC 1. I have installed and setup a mySQL server with a table of MS_Patch_Testing

I have created an account: testuser and gave it full rights to this Table

On my Test PC 2. I installed the myODBC drivers and configured and it connected fine.

I still have gotten nothing but errors when I try to connect with AutoIT to the mySQL database. I have tried soooo many different methods that I lost track. :evil:

I think I shale just step away from this for a while and see if anyone has some working code they might be willing to share.

Mike


Share this post


Link to post
Share on other sites

I think I shale just step away from this for a while and see if anyone has some working code they might be willing to share.

Good grief.

You've got code and even a screenshot of of a functioning DSN. If you're using XP, you can test connectivity directly from the interface. Play station to station baseball, and get the connectivity on one machine first - then if you fail w/ the second you know it's a permissions or firewall issue, since the code works locally.

The snippet I posted to create a database object and connection works, with a properly configured ODBC based DSN.


Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

Good grief.

You've got code and even a screenshot of of a functioning DSN.  If you're using XP, you can test connectivity directly from the interface.  Play station to station baseball, and get the connectivity on one machine first - then if you fail w/ the second you know it's a permissions or firewall issue, since the code works locally.

The snippet I posted to create a database object and connection works, with a properly configured ODBC based DSN.

<{POST_SNAPBACK}>

Yea that works but I don't want to use the myODBC drivers. I want to use something simmilar to the MSAccess examples from the Scripts and Scraps where the ODBC driver is not installed or configured. the Code does all the connection in the back ground.

Share this post


Link to post
Share on other sites

Yea that works but I don't want to use the myODBC drivers.  I want to use something simmilar to the MSAccess examples from the Scripts and Scraps where the ODBC driver is not installed or configured.  the Code does all the connection in the back ground.

<{POST_SNAPBACK}>

That's just the thing ... The access connection works like it does due to the fact that the access database drivers already exist. This is the reason you install the MyODBC drivers so they are accessible.

Maybe you should try the free version of Microsofts SQL Server

Microsoft SQL Server 2000 Desktop Engine


We have enough youth. How about a fountain of SMART?

Share this post


Link to post
Share on other sites

Thank you Sykes,

This looks like exactly what I need. It should be Years before I reach the 25 connections cap.

mike


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0