Hi Vishwa, I have used the above vb code and modified it as per my needs. The issue is that out of 5 times when i am running this vb. SQL Server articles, scripts, and discussion groups. Selecting Specific Database Records Stefan Cameron on Forms Building intelligent forms using Adobe LiveCycle Designer. See what this does for you. In order to run it, you have to have the Oracle ODBC driver installed on your PC its installed if you have Oracle installed. The Archives of the TeradataForum contains over 33,000 posts and the threads below are a representative sample. To help navigate the Archives, there are additional. Step to Add ADODB Connection References in Excel. Go to VB Editor Screen AltF1. Tools References3. From the List of Available References Select Microsoft Active. X Data Objects 2. Library You can select 2. Version or any other higher version of this reference. Click OK Connection String with SID Connection String with ServiceDB Name Oracle Connection String with SID Use the below Code for connecting to the Oracle Database. Sub OraConnection. Dim con As ADODB. Connection. Dim rs As ADODB. Recordset. Dim query As String. Adobe Acrobat Reader For Windows 98 Se Key. Set con New ADODB. Connection. Set rs New ADODB. Recordset. Replace below highlighted names with the corresponding values. Con DriverMicrosoft ODBC for Oracle. CONNECTSTRINGDESCRIPTION. ADDRESSPROTOCOLTCP. HOSTYour Host NamePORTPort Number. CONNECTDATASIDSID of your Database uidUser ID pwdPassword. Open the above connection string. Open str. Con. Now connection is open and you can use queries to execute them. It will be open till you close the connection. Oracle Connection String with Service Use the below Code for connecting to the Oracle Database. Sub OraConnection. Dim con As ADODB. Connection. Dim rs As ADODB. Recordset. Dim query As String. Set con New ADODB. Connection. Set rs New ADODB. Recordset. Replace below highlighted names with the corresponding values. Con DriverMicrosoft ODBC for Oracle. CONNECTSTRINGDESCRIPTION. ADDRESSPROTOCOLTCP. HOSTYour Host NamePORTEnter Port Number. CONNECTDATASERVICENAMEdatabase uidEnter User ID pwdEnter Password. Open the above connection string. Open str. Con. Now connection is open and you can use queries to execute them. It will be open till you close the connection. Driver Microsoft Odbc For Oracle Vb Script For Loop© 2017