Oracle Connection String

  • Thread starter Thread starter Lloyd
  • Start date Start date
L

Lloyd

I have a query I want to run against our oracle database. I have written a
connection string using some examples I found on the internet and it appears
that it connects successfully, but when I go to run the query, I still get
prompted to enter a password to connect to Oracle. Below is the code if
anyone has a suggestion on what I'm doing wrong.

thanks

Dim Cn As ADODB.Connection
Dim CP As ADODB.Command
Dim rs As ADODB.Recordset
Dim conn As String
Dim QSQL As String

'Connect to Oracele server begin
conn = "DRIVER={Oracle in
OraClient10g_home};SERVER=ServerINfo;UID=Username;PWD=Password;DBQ=LB75_LIVE_RMSDATA;DBA=W;APA=T;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;FRL=F;MTS=F;CSR=F;PFC=10;TLO=O;"

Set Cn = New ADODB.Connection

With Cn
.ConnectionString = conn
.CursorLocation = adUseClient
.Open
End With

If Cn.State = adStateOpen Then
MsgBox "Connection successful."
DoCmd.OpenQuery "qryName"
End If

'Connect to Oracle server end

'close connection begin
Cn.Close
Set Cn = Nothing
Set CP = Nothing
'close connection end
 
Lloyd said:
I have a query I want to run against our oracle database. I have written a
connection string using some examples I found on the internet and it appears
that it connects successfully, but when I go to run the query, I still get
prompted to enter a password to connect to Oracle. Below is the code if
anyone has a suggestion on what I'm doing wrong.

thanks

Dim Cn As ADODB.Connection
Dim CP As ADODB.Command
Dim rs As ADODB.Recordset
Dim conn As String
Dim QSQL As String

'Connect to Oracele server begin
conn = "DRIVER={Oracle in
OraClient10g_home};SERVER=ServerINfo;UID=Username;PWD=Password;DBQ=LB75_LIVE_RMSDATA;DBA=W;APA=T;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;FRL=F;MTS=F;CSR=F;PFC=10;TLO=O;"

Set Cn = New ADODB.Connection

With Cn
.ConnectionString = conn
.CursorLocation = adUseClient
.Open
End With

If Cn.State = adStateOpen Then
MsgBox "Connection successful."
DoCmd.OpenQuery "qryName"
End If

'Connect to Oracle server end

'close connection begin
Cn.Close
Set Cn = Nothing
Set CP = Nothing
'close connection end

I haven't used Access/Oracle in a while, but I think you need an account on Oracle with username and password. Oracle is just verifying who you are.
 
Back
Top