I am trying to get some SQL server tables into FoxPro dbf.
I successfully managed to bcp export data such that when I use FoxPro Import Wizard, the data imports correctly. But when I try to do it at the command line, I can at best import the first few columns and all the other columns disappear.
In the following directory, I put both the .CSV file and the successful DBF import table.
What I need to figure out is how to import these CSV files from the command line in FoxPro.
I tried various combinations of;
APPEND FROM D:\work\oh\output\sqloutput.csv TYPE CSV
APPEND FROM D:\work\oh\output\sqloutput.csv DELIMITED WITH TAB
None of it works.
Any ideas? I know I have done this before, I don’t remember what the trick was…
Wow.. I think you are going about it the wrong way… Just do a simple SQLCONNECT() to the SQL Database, run a query to the data source, stored procedure, or whatever and it’s in a cursor in VFP… Then, you can just “copy” to a DBF and you are done… Something like
(dialog pops up for you of ODBC connections).
if not that, you could do
Then
Now, if there are columns that are longer than 10 character column names, and you are NOT using a database container, you might have to adjust by either changing the query to GET the column names, or re-select the data once local to fit into 10 character non-dbc table context.
Another example to build out the query could be — for simplicity of readability while typing, I use text/endtext such as
The second is obviously MUCH easier to read what you are trying to get, and notice I’ve also pre-shortened the long column names to VFP 10 char non-DBC column name limit. Then, just copy out like the first example.