It is a pointer (reference) to the original table. Any operations you do with it, are being done with the original table.
It is not a local copy of the database.
Which confirms that it is a pointer (reference) to the original table, and that any operations you do with it, are being done with the original table.
These two feel unrelated. Can you temporarily do something like:
sub Filtrar_Tabla(disc_table as sql) as string
Return "dummy valid return value" 'debugging
Dim S as string
.
.
.
Return s
end sub
and see if the "too much files open" error still occurs?
If it does, then it is being caused by something else in your program, ie not by passing a disc_table here.
If it doesn't, then have a close look at the ". . ." code in the Filtrar_Tabla Sub at the file (or SQL?) operations.
Remember to comment out or delete the extra line after you've finished this test - in the heat of debugging battle, it'd be easy to forget to do this (or maybe it's just me that shoots myself in the foot like that).