Microsoft ODBC for Oracle

Scripts Diversos para o Oracle SQL*Plus. (Relacionado a ferramenta Oracle SQL*Plus, para questões de SQL, usar o forum SQL)
Post Reply
GabrielDB
Rank: Estagiário Sênior
Rank: Estagiário Sênior
Posts: 8
Joined: Sun, 03 Nov 2013 7:20 am

Good afternoon,

I need to make a connection to the Oracle database through VBScript Language. I have the connection script, but error is occurring due to some drive or configuration in the windos ODBC connection ADM.

What configuration I must perform, or drive install

script used

Select all

strcon = "Driver={Microsoft ODBC for Oracle};ConnectString=XXXX.world;Uid=USUARIO;Pwd=SENHA;"
User avatar
adrianoturbo
Moderador
Moderador
Posts: 393
Joined: Thu, 20 Mar 2008 4:09 pm
Location: Brasília
Adriano Alves
---Para cada problema dificil existe uma solução simples.----

Brother, starting from the beginning that Oracle is installed and working, I recommend that if you are using VBA in Excel: Point to Tools and Reference, check the option: Oracle Data Control, this post insert the code below with your user and password of your Bank:

Select all

 
 
Private Sub Command1_Click() 
 
Dim cn As New ADODB.Connection 
 
Dim rs As New ADODB.Recordset 
 
cn.CursorLocation = adUseClient 
 
cn.Open "Driver={Microsoft ODBC for Oracle}; " & _ 
"CONNECTSTRING=orcl;uid=scott;pwd=tiger;" 
 
rs.Open "select * from emp", cn 
 
MsgBox rs.RecordCount 
 
rs.Close 
 
cn.Close 
 
End Sub 
 
Now if you are using VB by Visual Studio is much more practical, just click on the Date menu and add a new Data Source that the same goes from Next and Next until the end .
Well, that's it, I hope I helped you.
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests