>hi,
>
>thank you very much,
>
>it works very well,
>
>i need som thing els if you can, evrey time the excel sheet(fields change some times 3 or 4 or etc..,how i can create mytable as the same number.of fields at excl sheet.
>i mean CREATE TABLE (thisform.text2.value)&& without fields (char1 C(10), char2 C(40),char3 C(10), char4 C(10) NOCPTRANS).creat fields as excel sheet autamticly.
>APPEND FROM c:\aax.xls TYPE XLS
>
>thanks again.
If you know what fields you have in your sheet, you can build up your entire CREATE TABLE command as a string and then execute it via a macro.
cCmd = "CREATE TABLE "+thisform.text2.value+" ("
cCmd = cCmd + yourfieldname1+" "+yourfieldtype+"("+yourfieldsize+"), " && repeat for all fields, leave comma off last field
cCmd = cCmd + ")"
&cCmd