goaway1234
Programmer
I am not an oracle expert, so this could be simpler than I'm making it out to be. I am working on an asp site that uses an Oracle back-end. On a particular page I have something like:
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.ConnectionString = "..."
cnn.Open
...
rst.CursorLocation = adUseClient
rst.Open strSQL, cnn, adOpenStatic
strSQL is a SELECT statement using a named sub-query (WITH ... As) The rst.Open statement executes without error, but the recordset does not open. Trying to get data from the recordset or examine its EOF property causes an 'object is closed or invalid...' error and rst.State indicates that the recordset is closed. The same sql statement works fine when I run it in SQLPlus.
Has anybody seen this before, and know how to work around it? If not, can you tell me of a way to use a field alias in the WHERE clause without the named sub-query?
The application that I am working on is old, very inflexible, and wrought with red-tape. I cannot do the more obvious solutions such as creating views, renaming fields, or changing anything in the database without breaking existing code and going through a frustrating proposal/approval process. Any help would be greatly appreciated.
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.ConnectionString = "..."
cnn.Open
...
rst.CursorLocation = adUseClient
rst.Open strSQL, cnn, adOpenStatic
strSQL is a SELECT statement using a named sub-query (WITH ... As) The rst.Open statement executes without error, but the recordset does not open. Trying to get data from the recordset or examine its EOF property causes an 'object is closed or invalid...' error and rst.State indicates that the recordset is closed. The same sql statement works fine when I run it in SQLPlus.
Has anybody seen this before, and know how to work around it? If not, can you tell me of a way to use a field alias in the WHERE clause without the named sub-query?
The application that I am working on is old, very inflexible, and wrought with red-tape. I cannot do the more obvious solutions such as creating views, renaming fields, or changing anything in the database without breaking existing code and going through a frustrating proposal/approval process. Any help would be greatly appreciated.