can u show me the connect string and the Query u given ?
Roshmon
Main Topics
Browse All TopicsHi,
I migrated SQL database (WINDOWS 2000) to ORACLE 8i running on SUN SOLARIS.
The front end was written in VB.
When i tried to connect to ORACLE database (remote) it fails, but some how it succedds after couple of failures.Again it fails. But i can connect to the database successfully by SQL PLUS with out any problems.
The error it gives when it fails is as follows.
"DB ACCESS - oracle error occured.But error message cannot be retrieved from oracle."
AND MICROSOFT VISUAL BASIC
"RunTime-error 3709
The connection cannot be used to perform this operation.It is either closed or invalid in this context"
PLEASE ADVICE ME ON THIS.
Thank You
Regards
Aruna.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Roshmon, I have sent the functions used to connect to ORACLE db
Oracle sid / Oracle service = ESL
User Id = billing Password = billing.
Arunab
--------------------------
'Function for ORACLE Databases
Public Function DBConnectORACLE(ByVal ServerName As String, ByVal UserName As String, ByVal Password As String) As ADODB.Connection
Dim err As Error
On Error GoTo Err_handler
Set cnBilling = New ADODB.Connection
'Define connection parameters
With cnBilling
.Provider = "MSDAORA"
.Properties("Data Source").Value = ServerName
.Properties("User ID").Value = UserName
.Properties("Password").Va
.Open
End With
'Passing connection to called procedure
Set DBConnectORACLE = cnBilling
Exit Function
'Handling all errors
Err_handler:
For Each err In cnBilling.Errors
MsgBox err.Description
Next
End Function
Public Function AssignDB() As ADODB.Connection
'This function to connect to database
Dim objDBConnect As DBAccess.DBConnect
On Error GoTo Err_handler
Set objDBConnect = New DBAccess.DBConnect
Set AssignDB = objDBConnect.DBConnectORAC
Exit Function
Err_handler:
MsgBox "Connection to Database is failed ...!", vbCritical, "Connecting to Database"
End Function
--------------------------
Folowing is the function used to connect (ie go into the program by giving userid/password which is not the user id/password used to loginng into ORACLE)
--------------------------
Public Function UserLogin(ByVal strparam1 As String, ByRef strparam2 As String) As ADODB.Recordset
'strparam1 as User ID and strparam2 as Password
Dim rsLOGIN As ADODB.Recordset
Dim strPassword As String
Dim intStatus As Integer
Dim sSQL As String
'Connect to the database
Set objdbaccess = New DBAccess.DBAssign
Set cnUSERS = objdbaccess.AssignDB
'Check whether user has entered the userid
If strparam1 = "" Then
intStatus = 4
'Check whether user has entered the password
ElseIf strparam2 = "" Then
intStatus = 4
'Insert the log entry
sSQL = "INSERT INTO Log_Events (lg_Description,lg_User,lg
cnUSERS.Execute sSQL
Else
Set rsLOGIN = New ADODB.Recordset
'Check whether user exist in the database
rsLOGIN.Open "SELECT * FROM Users WHERE Users.UserID ='" & strparam1 & "'", cnUSERS, adOpenStatic, adLockReadOnly
If Not rsLOGIN.EOF Then
Set objencdec = New PasswordProtection.Encrypt
'Check whether password is correct
If (strparam2 = objencdec.DecryptString(rs
'Insert the log entry
sSQL = "INSERT INTO Log_Events (lg_Description,lg_User,lg
cnUSERS.Execute sSQL
Set UserLogin = rsLOGIN
intStatus = 3
Else
intStatus = 2
'Insert the log entry
sSQL = "INSERT INTO Log_Events (lg_Description,lg_User,lg
cnUSERS.Execute sSQL
End If
Else
intStatus = 1
'Insert the log entry
sSQL = "INSERT INTO Log_Events (lg_Description,lg_User,lg
cnUSERS.Execute sSQL
End If
End If
'Pass the status using reference parameter
strparam2 = CStr(intStatus)
End Function
--------------------------
The Best OLE DB provider for Oracle is the one provided by Microsoft:
Private mADOConnection as ADODB.Connection
Private Sconnect as string
'Password and User ID should be WHATEVER you use to access the database database schema
sConnect = "Provider = MSDAORA.1; password = whatever; user ID = whatever; & _
"data source = ; persist security infor = true"
set mADOConnection = New ADOBD.Connection
With mADOConnection
.ConnectionString = sConnect
.ConnectionTimeout = 10
.CursorLocation = adUseNone
.Open
end with
__________________________
This uses an OLE Provider, there is another if you are using a DSN (ODBC) if all else fails, change the Connectionstring:
sConnect = "Server = " & THE SERVE NAME & "driver = {microsoft ODBC for Oracle}" & _
"; UID = WHATEVER; PWD = WHATEVER;"
Business Accounts
Answer for Membership
by: arunabPosted on 2003-05-07 at 04:18:33ID: 8478891
PLEASE ADVICE SOON AS POSSIBLE.