me,myself,english and programming..

AutoIT – Connecting to Oracle.

Previously I wrote about how to connect to SQL Server using AutoIt. Since that I’m using Oracle as my main database in my new workplace, I will show how to do the same thing for Oracle.

$conn = ObjCreate( "ADODB.Connection" )
$DSN = "Driver={Microsoft ODBC for Oracle};Server=ORCL;Uid=myID;Pwd=myPwd;"
$conn.Open($DSN)
$rs = ObjCreate( "ADODB.RecordSet" )
$rs.Open( "select BANNER from v$version where banner like 'Oracle%'", $conn )
MsgBox(0, "AutoIT-SQL Result", "Value = " & $rs.Fields( "BANNER" ).Value )
$conn.close

The codes will produce something like below.

autoit-oracle

 

Till then..

Happy coding..!

  1. 3 Responses to “AutoIT – Connecting to Oracle.”

  2. By kbguy on Mar 2, 2009 | Reply

    hi.. tak faham lah. haha..

  3. By arejae on Mar 2, 2009 | Reply

    hi kbguy, lamo tok dengar khabar deh.hopefully dmo sihat-sihat sokmo.

    hehe…pasal posting nie..takpo kalu tok pehe.ehehe.. :)

  1. 1 Trackback(s)

  2. Mar 2, 2009: AutoIt - Connecting to oracle without TNS Names | Arejae.Com

Post a Comment