>How can I add a table to the dataenvironment automatically?
>
>I tried to open the report as a table and then do:
>
>GO BOTTOM
>lcFile='Alias = "opslag"'+CHR(13)+CHR(10)+'CursorSource = '+LOCFILE("opslag.dbf")+CHR(13)+CHR(10)+'Name = "Cursor1"'
>REPLACE expr WITH lcfile
>USE
>
>This worked on one report I tried but on others the data environment just comes up empty.
I think you'd need a new record for each cursor, and then also some special handling to make that record come after the rest of the DE records and before the report objects... very tricky.
Why not just add a couple of lines to the dataenvironment's .init to open the needed tables in code?