v4nandu Posted December 9, 2021 Share Posted December 9, 2021 Hi Team, I am looking for a solution to connect MS SQL DB with an AutoIT bot. But I am getting error. I have <MSSQL.au3> & <SQLite.au3> and did not work... Local $sqlCon = _MSSQL_Con("IP Address","Username","password","DB_Name") $sqlCon = ObjCreate("ADODB.Connection") $sqlCon.Open(Provider="{SQL Server}"; Data Source="IP Address"; User ID="Username"; Password="password"; database="DB_Name";) Please suggest Link to comment Share on other sites More sharing options...
Developers Jos Posted December 9, 2021 Developers Share Posted December 9, 2021 Welcome, 18 minutes ago, v4nandu said: But I am getting error. I have <MSSQL.au3> & <SQLite.au3> and did not work... That doesn't help us to understand unless you give us all the details! Also show the/a runnable script so we can see what you are doing. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Earthshine Posted December 9, 2021 Share Posted December 9, 2021 (edited) i really hope you are not sending the literal "Username" and the literal "Password" as the actual username/password in that connect string Edited December 9, 2021 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
v4nandu Posted December 9, 2021 Author Share Posted December 9, 2021 $DSN = 'DRIVER={SQL Server};SERVER=' & $sServer & ';DATABASE=' & $sDatabase & ';UID=' & $sUID &';PWD=' & $sPWD & ';' $oConn = ObjCreate ("ADODB.Connection") $oConn.ConnectionTimeout = 3 ; default is 15 s (must be supported by data provider DSN) $oConn.Open($DSN) Thanks Jos for the quick reply... I got the issue solved using this MS SQL connection - AutoIt General Help and Support - AutoIt Forums (autoitscript.com) Earthshine - that was nice... Thanks team Earthshine 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now