insert nulls into foxpro tables using visual foxpro driver

insert nulls into foxpro tables using visual foxpro driver

Post by andy » Sat, 19 Apr 2003 19:03:51



The documents of visual foxpro driver say it can support
Foxpro tables, so I export some tables(.dbf files) and
using visual foxpro driver to connect them using free
table format. Then...all the columns in the tables are
turned to NOT NULL, I try to insert null values into these
tables by modify the connection string and set "NULL=NO",
the msdn documents say this will insert blanks for null
values. So it does, it turns null numbers to zero, and
null date value to 12-30-99, this is not acceptable. Can
anybody tell me how to correct this and set the columns to
NULL?
 
 
 

insert nulls into foxpro tables using visual foxpro driver

Post by Cindy Winegarde » Sat, 19 Apr 2003 22:55:42




Quote:> The documents of visual foxpro driver say it can support
> Foxpro tables, so I export some tables(.dbf files) and
> using visual foxpro driver to connect them using free
> table format. Then...all the columns in the tables are
> turned to NOT NULL, I try to insert null values into these
> tables by modify the connection string and set "NULL=NO",
> the msdn documents say this will insert blanks for null
> values. So it does, it turns null numbers to zero, and
> null date value to 12-30-99, this is not acceptable. Can
> anybody tell me how to correct this and set the columns to
> NULL?

Hi Andy,

FoxPro has more than one table format, and the Visual FoxPro ODBC driver
will support both formats.

The older FoxPro for DOS/Windows table format does not support nulls and you
will get the behavior you described if you try to insert them. The newer
Visual FoxPro table format accepts nulls.

If the tables are in the FPW format and need to be shared by an older
application that requires them to be in this format then you will have no
ability to work with nulls. If the tables don't need to be shared I think
you could create new tables (that will be in the VFP format) and move all
the data to them.

--
Cindy Winegarden  MCSD, Microsoft Visual FoxPro MVP

http://msdn.microsoft.com/vfoxpro  http://foxcentral.net