I have written an app in VB6 that needs to do a select count(*) or max(refid) from a table in Oracle. It works fine in MS-Access and in SQL-Plus Oracle tool, but VB comes back with Run Time error 3704 , "Operation is not allowed when the object is closed".
Code being used is
Private Function Get_New_ID() As Long
'Generate a new internal REFID
Dim lrs2 As New ADODB.Recordset
lrs2.Open "Select max(refid) from tbl_toaster", gsConnect_String, adOpenStatic, adLockOptimistic
If Not lrs2.EOF Then
Get_New_ID = lrs2!REFID + 1
Get_New_ID = 1
This select works fine in Oracle Sql-Plus!
Select max(refid) from tbl_toaster
It is urgent as I am on a client site and need to get this finished!!!!!! Thanks.....