General information
Category:
Coding, syntax & commands
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only