>Hi,
> I'm trying to create a VFP table on the internet using an SQL statement. I can not find the correct command for this. So far I'm able to add, change, delete records. I also can delete a table. The standard VFP command does not work using the ODBC SQL for FoxPro.
Ed,
To create a table via VFP's ODBC driver the SQL command syntax would be:
CREATE DBF TableName (FIELD1 FieldType (width [, precision]),FIELD2 FieldType (width [, precision]))
For example to create a table using VBScript:
Set ox = Server.CreateObject("ADODB.Connection")
ox.Open "your_ODBC_DSN"
Ecmd="CREATE DBF C:\your_dest_path\yourdbf (FIELD1 C(5), FIELD2 L)"
ox.Execute(Ecmd)
ox.close
set ox=nothing
Check VFP's help under CREATE TABLE SQL for more information.
Note that you must include the destination path of the DBF to be created regardless of the DSN source. The above code works with latest VFP ODBC driver configured for FREE tables. I have not tested with VFP's ODBC DBC container nor have I used VFP's odbc driver with cold fusion.
HTH,
Mike
Michael McLain