Home » Developer & Programmer » Forms » General
General [message #233725] Fri, 27 April 2007 04:26 Go to next message
anilkulkarni
Messages: 22
Registered: April 2005
Junior Member
I am getting the following error when i am
trying to open a connection.
[Microsoft][ODBC driver for Oracle][Oracle]ORA-00604"
error occured at recursive SQL level %s

following is the code from which I am getting the disconnected recordset.

Public Function getRecordset(ByVal strStmt As String) As ADODB.Recordset
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim strConn As String
strConn = "Driver=Microsoft ODBC for Oracle;Server=" & dbServer & ";UID=" & dbUserName & ";PWD=" & dbPassword & ";"
cn.Open strConn, dbUserName, dbPassword
rs.CursorLocation = adUseClient
rs.Open strStmt, cn, adOpenForwardOnly, adLockReadOnly
Set rs.ActiveConnection = Nothing
cn.Close
Set getRecordset = rs
Exit Function
End Function

I am not able to understand where the problem is

please help me out on this.

Thanks in advance
Anil Kulkarni
Re: General [message #233726 is a reply to message #233725] Fri, 27 April 2007 04:32 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This is what Oracle says about it:
Oracle
ORA-00604: error occurred at recursive SQL level string


Cause: An error occurred while processing a recursive SQL statement (a statement applying to internal dictionary tables).

Action: If the situation described in the next error on the stack can be corrected, do so; otherwise contact Oracle Support.


So, is there any next error message (another ORA-something)?
Re: General [message #233736 is a reply to message #233726] Fri, 27 April 2007 04:37 Go to previous messageGo to next message
anilkulkarni
Messages: 22
Registered: April 2005
Junior Member
The error is coming at the following line

cn.Open strConn, dbUserName, dbPassword

No other error message is displayed.
Re: General [message #233741 is a reply to message #233726] Fri, 27 April 2007 04:42 Go to previous messageGo to next message
anilkulkarni
Messages: 22
Registered: April 2005
Junior Member
The error is coming while opening the connection not at the point of execution of the SQL Statement

Re: General [message #233768 is a reply to message #233741] Fri, 27 April 2007 07:23 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Can you check whether given combination of username (dbUserName), password (dbPassword) and database alias (strConn) are correct? Is there a way for you to try something like
c:\> SQLPLUS scott/tiger@ora10

and see if it works OK?
Re: General [message #233888 is a reply to message #233768] Fri, 27 April 2007 23:50 Go to previous messageGo to next message
anilkulkarni
Messages: 22
Registered: April 2005
Junior Member
I am reading those parameters (username,password and hostname) from the INI file.
more over i am able to connect thru the SQL Plus but not thru the application.

I have stopped the database on the server and restarted the services of the database then it is working fine.

can you please let me know what should i do if without restarting the database services on the server.


Re: General [message #236454 is a reply to message #233888] Thu, 10 May 2007 01:01 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you solved your problem?

David
Re: General [message #236462 is a reply to message #236454] Thu, 10 May 2007 01:10 Go to previous messageGo to next message
anilkulkarni
Messages: 22
Registered: April 2005
Junior Member
No
Re: General [message #236790 is a reply to message #236462] Fri, 11 May 2007 00:52 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Please confirm that you can connect to the database through ODBC using SQL*Plus.

Have you searched this forum for 'odbc'?

Have a look at:
connect 6i with MS Access
http://www.orafaq.com/forum/m/172737/67467/?srch=odbc+tnsnames#msg_172737

David
Re: General [message #236803 is a reply to message #236790] Fri, 11 May 2007 01:11 Go to previous messageGo to next message
anilkulkarni
Messages: 22
Registered: April 2005
Junior Member
I am getting the following error when i am
trying to open a connection.
[Microsoft][ODBC driver for Oracle][Oracle]ORA-00604"
error occured at recursive SQL level %s

following is the code from which I am getting the disconnected recordset.

Public Function getRecordset(ByVal strStmt As String) As ADODB.Recordset
Dim cn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim strConn As String
strConn = "Driver=Microsoft ODBC for Oracle;Server=" & dbServer & ";UID=" & dbUserName & ";PWD=" & dbPassword & ";"
cn.Open strConn, dbUserName, dbPassword
rs.CursorLocation = adUseClient
rs.Open strStmt, cn, adOpenForwardOnly, adLockReadOnly
Set rs.ActiveConnection = Nothing
cn.Close
Set getRecordset = rs
Exit Function
End Function

If i restart the database services then it is working fine but we can restart the services on the server every day.

I am getting this problem daily, please help me to solve the same


Re: General [message #236826 is a reply to message #236803] Fri, 11 May 2007 01:46 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Which part of my previous post is unclear? Please respond to each paragraph, in order and in a separate paragraph.

I saw your code in your first post, you don't have to post it again. Also, as it IS code please put 'code' tags around it.

David

Upd: Typo.

[Updated on: Fri, 11 May 2007 01:47]

Report message to a moderator

Re: General [message #236835 is a reply to message #236826] Fri, 11 May 2007 02:02 Go to previous messageGo to next message
anilkulkarni
Messages: 22
Registered: April 2005
Junior Member
I am able to connect thru the SQL*plus.

The error is coming at the following line

"cn.Open strConn, dbUserName, dbPassword"

Thanks in advance.

Re: General [message #236840 is a reply to message #236835] Fri, 11 May 2007 02:16 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Can you put a display of 'strConn' between the two lines
strConn = "Driver=Microsoft ODBC for Oracle;Server=" & dbServer & ";UID=" & dbUserName & ";PWD=" & dbPassword & ";"
cn.Open strConn, dbUserName, dbPassword
so that we can see exactly what you are passing to the 'Open'.

David
Re: General [message #236845 is a reply to message #236840] Fri, 11 May 2007 02:27 Go to previous messageGo to next message
anilkulkarni
Messages: 22
Registered: April 2005
Junior Member
See the following code

strConn = "Driver=Microsoft ODBC for Oracle;Server=" & dbServer & ";UID=" & dbUserName & ";PWD=" & dbPassword & ";"

cn.Open strConn, dbUserName, dbPassword


Thanks in advance
Re: General [message #236848 is a reply to message #236845] Fri, 11 May 2007 02:33 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I can't see the display statement and I need to see the contents of 'strConn'.

David
Re: General [message #236852 is a reply to message #236848] Fri, 11 May 2007 02:42 Go to previous messageGo to next message
anilkulkarni
Messages: 22
Registered: April 2005
Junior Member
See the following code

strConn = "Driver=Microsoft ODBC for Oracle;"
strConn = strConn & "Server=" & dbServer & ";"
strConn = strConn & "UID=" & dbUserName & ";"
strConn = strConn & "PWD=" & dbPassword & ";"

cn.Open strConn, dbUserName, dbPassword

Thanks in advance
Re: General [message #237263 is a reply to message #236852] Mon, 14 May 2007 00:31 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
What I am looking for is a statement that will display the contents of 'strConn' on the screen.

For example, in Forms
..
..
..
  strConn = 'Driver=Microsoft ODBC for Oracle';
  message('strConn=>'||strConn||'<');
  pause;
..
..
will display "strConn=>Driver=Microsoft ODBC for Oracle<" in the message area.

Can you write something like this in your code please?

David
Previous Topic: execute query-lov problem
Next Topic: Record Group In clause
Goto Forum:
  


Current Time: Thu Sep 26 22:46:43 CDT 2024