Exporting a table to foxpro using a stored proc

  • Hello everybody,

    I have a requirement to write a stored procedure in SQL server 2005 which will be passed a table name as a parameter and will export the resulting table as a Foxpro (.dbf) file.

    Since I am new to SQL server, I tried using their import export wizard using the ole db provider for foxpro but ran into the following errors...

    Error 0xc0021210: Preparation SQL Task: Executing the query "CREATE TABLE 'CODES_SAMPLE' ('CODE' C(12), 'DESCRIPTION' C(40) )" FAILED with the following error. "Field name is duplicate or invalid". Possible failure reasons: Problem with the query, "resultset" property not set correctly, parameters not set correctly, or connection not established correctly.

    I did test the connection and it worked. I am selecting the free table directory option. At times, it throws out an empty structure.

    I would appreciate it if you could provide me the code for the foxpro connection.

    Thanks!

  • That particular error usually means there is a duplicate column name in the query. It will parse okay, but will give that error when it runs.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply