Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

SQL connection help

$
0
0
Greetings,

I am new to autoit and currently working on a project to automate querying data from a SQL server and sending that to another software to generate a PDF file. i've been spending some time reading fourms and wrote a script to connect to my sql server using the mysql.au3 UDF. My understanding is inorder to use a UDF i just download the script and use it with include


#include <mysql.au3>

$sUsername = "xxxxxxx"
$sPassword = ""
$sDatabase = "xxxxxxxxx"
$sServer = "xxxxxxxx"
$sDriver = "SQL Server"
$iPort= 1433
$sql=_MySQLConnect($sUsername, $sPassword, $sDatabase, $sServer, $sDriver, $iPort)

if $sql = 0 Then
MsgBox(1,"Connection to Sql Server", "Did not connect")
Else
MsgBox(1,"Connection to Sql Server", "connected")
EndIf
_MySQLEnd($sql)

good news my code is fine and executes without a problem, bad news _MySQLConnect function is returning a 0 meaning is not connection and i am unsure to why its not connecting. If anyone can help me out and point me in the write direction will greatly appreciate it. some information about my sql database (Microsoft SQL Server ODBC Driver Version 06.01.7601)



hanwar00

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>