Discussion:
Create a table in runtime
(too old to reply)
Eusebio
2004-11-17 13:21:28 UTC
Permalink
Hi,

I need to create a table in runtime, the definition's table is in a
variable.

strCadCreate = "create table Txx ( campo1 type, c2 type ) "
I need to execute the CREATE TABLE statement strCadCreate

how I do?
Eric den Doop
2004-11-17 13:40:50 UTC
Permalink
Hello, Eusebio!
You wrote on Wed, 17 Nov 2004 08:21:28 -0500:

E> I need to create a table in runtime, the definition's table is in a
E> variable.

E> strCadCreate = "create table Txx ( campo1 type, c2 type ) "
E> I need to execute the CREATE TABLE statement strCadCreate

&strCadCreate
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8
vfpDev@hotmail.com
2004-11-24 12:41:03 UTC
Permalink
I need to append data from .DB file (Paradox) to a DBF table. How can I do
that? What are the table structure conditions?

thanks
Post by Eric den Doop
Hello, Eusebio!
E> I need to create a table in runtime, the definition's table is in a
E> variable.
E> strCadCreate = "create table Txx ( campo1 type, c2 type ) "
E> I need to execute the CREATE TABLE statement strCadCreate
&strCadCreate
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8
Sietse Wijnker
2004-11-24 12:59:36 UTC
Permalink
Hi,
You have two options:
1.
Create the table yourself using the CREATE TABLE
Append the data to the table using the APPEND command:
APPEND FROM pdoxFile TYPE PDOX
This will fill the table with the data from the paradox file. The fields
that exist in both the files will be filled in the resulting table.

2.
Create the table based on the Paradox file and fill it with the data in
one move. The resulting able will have the same filename as the Paradox
file, but with the DBF extension:
IMPORT FROM pdoxFile TYPE PDOX

HTH,
Sietse Wijnker
Post by ***@hotmail.com
I need to append data from .DB file (Paradox) to a DBF table. How can I do
that? What are the table structure conditions?
thanks
<rest snipped>
Sietse Wijnker
2004-11-18 16:05:21 UTC
Permalink
Hi Eusebio,
If you're using vfp7+:
=Execscript(strCadCreate)

You can even create indexes in the same script:
TEXT TO strCadCreate NOSHOW
create table Txx ( campo1 C(10), c2 C(10))
INDEX ON campo1 tag campo
RETURN USED("Txx")
ENDTEXT
boolSuccess=Execscript(strCadCreate)

The statement currently in the string will fail. You need to specify the
type.

HTH,
Sietse Wijnker
Post by Eusebio
Hi,
I need to create a table in runtime, the definition's table is in a
variable.
strCadCreate = "create table Txx ( campo1 type, c2 type ) "
I need to execute the CREATE TABLE statement strCadCreate
how I do?
Eusebio
2005-01-04 22:19:47 UTC
Permalink
Thank you very much Sietse,

unfortunately my vfp version is 5, but @textScript work ok

Eusebio
Post by Sietse Wijnker
Hi Eusebio,
=Execscript(strCadCreate)
TEXT TO strCadCreate NOSHOW
create table Txx ( campo1 C(10), c2 C(10))
INDEX ON campo1 tag campo
RETURN USED("Txx")
ENDTEXT
boolSuccess=Execscript(strCadCreate)
The statement currently in the string will fail. You need to specify the
type.
HTH,
Sietse Wijnker
Post by Eusebio
Hi,
I need to create a table in runtime, the definition's table is in a
variable.
strCadCreate = "create table Txx ( campo1 type, c2 type ) "
I need to execute the CREATE TABLE statement strCadCreate
how I do?
Loading...