Error in Select Statement
0 pts.
0
Q:
Error in Select Statement
I have connected VB to ORACLE by ADODB connection.
When I am trying to access data from different schema it?s showing an error message
?[Oracle] [ODBC] [Ora] ORA-01013: User requested cancel of current operation?

If I am querying by specifying the data in the field it?s not giving any error.

The function I used for connection is
Public Function ConnectToDb()
Set cn = New ADODB.Connection
With cn
.ConnectionString = "provider = MSDASQL;DSN=DsnName;USR=UserID;PWD=Password"
.Open
End With
Exit Function

The function I used for selection is

Public Function ExecuteSelect(query As String) As ADODB.Recordset
Dim Rs As New ADODB.Recordset
Rs.CursorLocation = adUseClient
Rs.Open query, cn
Set ExecuteSelect = Rs
End Function

Your attention and response to this email is appreciated.
ASKED: Mar 27 2006  10:31 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
0 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
I do not have any ORACLE experience, but I have seen this with SQL Server 2000. It is usually a time-out error, and changing the connection string timeout has solved it in the past.
Last Answered: Mar 27 2006  11:22 AM GMT by PurpleLady   0 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

A09969   0 pts.  |   Mar 28 2006  10:52AM GMT

I agree it is probably a timeout issue. You can set the timeout in the web.xml (use standard html tags - substituted parenthesis to comply with ‘whatis’ rules):

(session-config)
(session-timeout)480(/session-timeout)
(/session-config)

If this is a company standard timeout, exceptions may have to be pointed to new original URL to pick up the different setting.

 

rloveall   0 pts.  |   Mar 29 2006  7:47AM GMT

You say you’re connecting to two different schema’s but show only one connection. What is the code for the second connection? and what’s the Select statement? You state it works when specifing the data for the fields, can you be more specific?

 

A09969   0 pts.  |   Mar 30 2006  11:09AM GMT

Don’t know if you’re still having problems or not. Here are a couple more thoughts.
1) to be tidy you should set your recordset to nothing after using it:
Set ExecuteSelect = Rs
Set Rs = Nothing
End Function

2) This is from another web site: Use a SQL Pass Through query instead. You would use Oracle syntax in it and send it to the server where the whole thing is processed and only the result are returned. The results are read
only though.

I (someone else) used one for a huge delete query. The time it took for Access to do it was over 8 hours. Oracle did it in less than 5 minutes. Network communication
was the problem. If the data had been local to Access, it would have been extremely fast too.

In fact Access is probably faster than Oracle or SQL Server in many respects when the file is local.

 

DaveInAZ   0 pts.  |   Mar 31 2006  10:59AM GMT

What is the actual SQL statement you’re trying to execute? ORA-01013 is usually not the real problem. If the ORA-01013 error is preceded by any other error, then it is probably the preceding error that needs to be investigated.

This bit is a quote—
Timeouts are a frequent cause of ORA-01013. This can be difficult to identify because a timeout may not be explicitly reported as part of the error.

The Oracle 8 ODBC driver implements a timeout, the previous Oracle 7 ODBC driver did not. SQL*Net also implements a timeout. This is specified via the ’sqlnet.expire_time’ parameter in the ’sqlnet.ora’ file.
—-

You might also want to take a look at <a href="http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:704225010478" title="http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:704225010478" target="_blank">http://asktom.oracle.com/pls/ask/f?p=495…</a>

 

mortree   0 pts.  |   Apr 3 2006  8:06AM GMT

Could it be simple syntax? SQL on Oracle and MSSQL or Access is not always precisely the same. The statement that works may just be the case where the syntax is the same.

 
0