Re: Cannot access the selected table ( Error 1152 )

Author: Javed Aslam

Posted: 2000-02-19 at 12:13:31

<I><FONT COLOR="#663300">Hi All,

I have an ibaseform which contains an icontainer control which contains controls subclassed from the isecctl class library.I'm using SQL statements to load data from my local database tables into cursors and setting my controls' rowsource properties to these cursors.

The problem I'm having occurs when I attempt to run a method I created. The method first uses a table exclusively, creates a cursor on certain filters on the table, unuses that cursor, then performs a delete operation, issues a pack command, performs an insert operation (SQL - Insert clause), sets exclusive off, then unuses the table. After the method executes and I move my mouse around the form or click the close button, I get the Error: "Cannot acces the selected table (Error 1152)" message pop up. Funny thing is that the method executes its function perfectly.

I've tried switching work areas and not unusing the table in question, the same result. There is no data environment set here, and the data session only shows the cursors I've created using the SQL - SELECT clauses. Does anyone have any idea what could be going on here?

Regards,</FONT></I>

Richard,

I have encountered this error many times, and everytime it leaves me bald while trying to find the cause. This is one of those things where the debugger is also of little help. The times when I have seen this is when on the same form I have 2 or more instances of the same ComboBox, usually on different pages, with the rowsource of each set to the same cursor. In such cases, whenever I have changed the 'name' of the cursor in one of the rowsources to something different, even though it contains the same exact data, the error disappears.

HTH

Regards

Javed

©2000 Javed Aslam