Oracle Connection String

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
 
Joined
Dec 17, 2007
Messages
57
Reaction score
0
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top