Denis,
Does these views really need to be so dynamic? I would think they could be constructed once and only updated when you have a change to your database structure or your mapping tables. Can you just run SQL queries on the external DBC instead of using it in an OPEN DATABASE? Remember a .DBC is just a dbf with a different extension.
I know these C05 errors are quite toublesome, but since they don't happen any longer in VFP9 it won't be fixed in this older version of VFP so finding a work around is the only alternative. Is there a reason you can't just run this app under VFP9?
>Thanks for attention to my probem...
>realy. Today I try to prepare separate example of this probem for you.. and no C0000005 error happen... but I using same database table as source for localview. To prepare extended example need time ;) so.. your code and my little ex. code - works perfect.
>
>But my app always crush on CREATE SQL VIEW... always...
>(this is program for database replication)
>I don't understand why it happens but steps of program is next:
>
>1) Database has "transaction" table. I made insert new record to this table with "soure_database","source_table","unique_id" (source of replication)
>2) "transaction" table has "oninsert" event - this event call replication between diffrent databases ( I have special table which contains relations and list of fields to update, and additional scripts and so on)
>3) prgram looking for special relations between database.. OPEN DATABASE (destinationDatabase) and then switch back to current database and create new Localview based on EXTERNAL database.
>4) and then - application crush.
>
>Maybe because I switch betweed diffrent databases inside stored procedure its happens..