ed_hand


I'm trying to bulk load tables in SQL 2005 from a Visual FoxPro 7 database. We have the latest VFP OLE DB driver loaded and have run into an odd issue.

When viewed from the table designer in VFP the tables have all columns set to not null (null column is not checked). However there are lots of rows with "empty" values for columns with both numeric and date data types. When I select these columns from an ODBC test app with the old (version 6.something) odbc driver they are filled with spaces.

When I run a select on the tables from SQL 2005 these "empty" values come back as a default value based on the columns data type; 0 for numeric columns and 12/30/1899 for date fields.

Now, for the first question, from the OLE DB side of things, is there a way to prevent the OLE DB driver from manufacturing data I can use a case statement to catch and remove the default date as 12/30/1899 isn't in the data. But there is no way to know when a returned 0 for a numeric field is a a valid value and when it was stuffed because the so-called non-null field had no value in it.

Or if not, part two, can the old version 6 odbc driver be used from SQL 2005 I have a system DSN defined that works from an ODBC test app when using ODBC 2.0 syntax, but SQL 2005 doesn't seem to want to connect to it.

linked server created with:

EXEC master.dbo.sp_addlinkedserver 'ODBCLINKTEST', '', 'MSDASQL', 'SystemDSN'

and the query results...

select * from [odbclinktest]...tablename

Msg 7313, Level 16, State 1, Line 1

An invalid schema or catalog was specified for the provider "MSDASQL" for linked server "odbclinktest".

Any hint, tips, tricks, etc. greatly appreciated.

Thanks,

Ed