Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create dummy name for table?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00361033
Message ID:
00361036
Views:
21
>I am creating a program in which I create tables to preview reports. I delete the temporary tables after the report is done being viewed/printed. The program is a multi-user program and if it so happens that User A is previewing the report and User B wants to view the same report they would get an error because it tries to create a table with the same name.
>
>I have thought of two options. One would be creating a different name for the table everytime it's created (based on a datetime stamp or something), but the question is how do I refer to it in my create table command?
>
>create table (blah);
>
>The second option is just to lock the table and use some sort of wait window for User B until the program is done, but this is less desirable as the first option.
>
>Any help is greatly appreciated.

Take a look at the SYS(2015) function:
LOCAL lcTable
lcTable = SYS(2015)

CREATE TABLE (lcTable) ...

do some stuff...

* Cleanup:
ERASE (lcTable + ".DBF")
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Reply
Map
View

Click here to load this message in the networking platform