Jump to content

MS SQL Server connection with AutoIT


v4nandu
 Share

Recommended Posts

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

  • Developers

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

$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 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...