me,myself,english and programming..

AutoIt – Connecting to oracle without TNS Names

In my previous post, I’m showing the way how to connect to oracle database using AutoIt. If you see the connect string, you will find it is very simple since we already define the entry ORCL in tnsname.ora file.

$DSN = "Driver={Microsoft ODBC for Oracle};Server=ORCL;Uid=myID;Pwd=myPwd;"

If for a some reason, you need to connect to oracle database without doing an entry in tnsname.ora file, below is the way how to do it.

$DSN =   "Driver={Microsoft ODBC for Oracle}; " & _
         "CONNECTSTRING=(DESCRIPTION=" & _
         "(ADDRESS=(PROTOCOL=TCP)" & _
         "(HOST=192.168.1.6)(PORT=1521))" & _
         "(CONNECT_DATA=(SERVICE_NAME=orcl))); uid=myID;pwd=myPWD;"

That’s all.

 

Happy coding !!

p/s: Time is running so fast. do you think so ??

  1. 2 Responses to “AutoIt – Connecting to oracle without TNS Names”

  2. By sumanvarma on Mar 16, 2009 | Reply

    Can you explain how to read and write data to Oracle using Autoit.

  3. By arejae on Mar 20, 2009 | Reply

    sure.. i plan to show it in my next post. see u then.

Post a Comment