Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Base Tables
Message
From
20/12/2017 13:23:59
 
 
To
20/12/2017 13:07:18
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01656587
Message ID:
01656593
Views:
43
>>I need to export 300+ SQL tables to Foxpro DBFs.
>>Don't ask why the customer just wants it.
>>
>>I can open the SQL table that has all the table names in it.
>>My plan is to scan that table and get each name then do a SELECT * from (that table name)
>>Then copy to (That table name)
>>
>>I running into Syntax issues
>>
>>
>>I do not know how toi pass the table name into the next Select statement
>>nor how to select that table and copy it to a folder using the table name selected
>>
>>I have this so far
>>
>>STORE SQLStringConnect ("Driver=SQL Server;UID=;pwd=;server=;Database=") TO gnConnect
>>
>>*** I removed the login credintials
>>
>>
>>SQLEXEC(gnConnect,lcSQLCMD,'TableNames')
>>
>>* To avoid a busy connection error this must be done
>>* after SQLEXEC() is on complete
>>IF SQLGetProp( gnConnect , 'ConnectBusy')
>> SQLCANCEL(gnConnect )
>>ENDIF
>>
>>
>>SELECT TableNames
>>
>>
>>GOTO Top
>>SCAN WHILE !EOF()
>> Tname=''
>> SaveTo=''
>> Tname=TableNames.Table_Name
>> SaveTo="c:\a\"+Tname
>> lcSQLCMD=[ select * FROM ?Tname];
>>
>> SQLEXEC(gnConnect,lcSQLCMD,'SelectedTable')
>> * To avoid a busy connection error this must be done
>> * after SQLEXEC() is on complete
>> IF SQLGetProp( gnConnect , 'ConnectBusy')
>> SQLCANCEL(gnConnect )
>> ENDIF
>> SELECT SelectedTable
>>
>>ENDSCAN
>
>Can
>
>Tname = ALLTRIM(TableNames.Table_Name)
>
>make a difference?


now I get after this
SELECT SelectedTable

SelectedTable not found


I am guessing SQL didn't like the ?Tname
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform