Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 db library function bcp_readfmt not able to read the format file

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-02-07 : 17:36:37
purushotham writes "We have a C application. It uses the DB-Library to access the SQL server. It does the bulk copy operations on MS SQL 2000.

This application does a bulk copy in and out of the SQL Server using a format file. We did generate a format file using the BCP utility of the SQL server.The command is given below -

bcp NorthWind..Customers out c:\gcp\customers.dat -Uusername -Ppassword.

the format file was generated while the execution of the above command with all the default values.

The C code is as shown below -
if(bcp_init(dbproc,tablename, datafile, errfile, DB_OUT) == FAIL)
errormessage

if (bcp_control(dbproc, BCPBATCH, (DBINT) 1000) == FAIL)
errormessage

* if (bcp_readfmt(dbproc,formatfile) == FAIL)
errormessage

if(bcp_exec(dbproc,&rows) == FAIL){
errormesage
}
*I am facing the problem here. It says "Attempt to read the unknown version of the BCP format file". It is just not reading the format file created.

SQL server - SQL SERVER 2000
Operating system - Windows 2000
C Compiler used - VC++ 6.0

Will you kindly provide us with a solution for this.waiting for ur reply -

regards,
Purushotham."
   

- Advertisement -