AutoIT - Connecting to SQL Server.
Playing around with AutoIt take me to next level of coding.
This time I need to automate a process where in a normal situation it will involve a few people to make the whole process completed.
One of the process need a connection to MS-SQL ,execute query and and get the results. As sharing is caring, here I share how to connect to SQL-Server using AutoIt.
$conn = ObjCreate( "ADODB.Connection" )
$DSN = "DRIVER={SQL Server};SERVER=MySvr;DATABASE=MyDB;UID=MyUser;PWD=MyPwd;"
$conn.Open($DSN)
$rs = ObjCreate( "ADODB.RecordSet" )
$rs.Open( "SELECT @@VERSION AS myVersion", $conn )
MsgBox(0, "AutoIT-SQL Result", "Value = " & $rs.Fields( "myVersion" ).Value )
$conn.close
The code will produce a msg box like below.

Here you go…it’s only the basic code. You can do a lot more than this.
Have a nice weekend.
p/s: I have a job to do this weekend…..so..not a very nice weeked for me.adoii….
If you're new here, you may want to subscribe to my RSS feed or get my latest post directly in your mailbox. Thanks for visiting !

I once used autoit for making a bot for angels online but its quite so I stop. Autoit is quite good if you know programming and definitely not for me douh..
Halim-Belajar SEO’s last blog post..Using GoDaddy for domain registration.
yeah…need to know at least a little bit programming.
spammer also like this kind of automate tools.
Thanks