I am writing a routine using the SQL Server Driver extension to use BPC under ODBC.
I get a table name, with arbitrary column names and types and lengths, and wish to create a BPC format file to im[port a csv file into that table. All I have from the csv file is the column names and the delimiters, I do not have the maximum field lengths from the csv file yet, I have not yet read it beyond the first row.
I got through all the odbc setup stuff, and did the bpc_init(), that worked.
The next was a bcp_control(... BCPUNICODEFILE,IN), which returnd a SUCCEED.
When I did the bcp_writefmt(... DB_IN), it returns a 0 .
A SQLGetDiagRec() returns a SQL_NO_DATA, so I don't have a clue as to what is wrong.
I am of course assuming the "bcp thru odbc" is capable of creating a format file the same as a command line bcp execution is.
I am not using a command line process because I have no way of knowing right now what code page the command line interpreter will be using and the conflict that may have with the code page needed for the column names. We had a problem with mis-matches at a remote customer site.