Home > Archive > dBASE Questions and Answers > December 2005 > Has anyone written to Foxpro Memo Fields









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Has anyone written to Foxpro Memo Fields
Tom Gormley

2005-12-01, 7:23 am

I have set up a link foxpro database with (odbc and bde)
i have downloaded and instaled the latest foxpro odbc drivers.

I can read the tables and ammend the foxpro tables.
I can creating a record in a table so long as i set "default" values in the table.
foxpro_table.rowset.beginedit()
foxpro_table.rowset.fields["Numeric field"].value = 0
foxpro_table.rowset.fields["charcter_field"].value = ""
foxpro_table.rowset.save()

however i cannot create a record if the table contains memo fields because i cannot assign a default value with

foxpro_table.rowset.fields["memo_field"].value = ""

I get the following message when i try to create a new record in the table.

Server Error: [Microsoft][ODBC Visual FoxPro Driver]Field COMMENTS does not accept null values.
Tom Gormley

2005-12-04, 7:23 am

Writing to foxpro tables v7.0 and v9.0
The odbc driver/bde dosent seem to allow/support null values.
My soloution is to initalise the fields to default values

foxpro_table.rowset.beginedit()
foxpro_table.rowset.fields["Numeric field"].value = 0
foxpro_table.rowset.fields["charcter_field"].value = ""
foxpro_table.rowset.fields["memofield"].value = " " // not ""
foxpro_table.rowset.fields["datefield"].value = ctod("31/12/1999")
foxpro_table.rowset.fields["logicalfield"].value = false
foxpro_table.rowset.save()


Just a pity i cant get odbc to speed up a bit !!!!!





Tom Gormley Wrote:

> I have set up a link foxpro database with (odbc and bde)
> i have downloaded and instaled the latest foxpro odbc drivers.
>
> I can read the tables and ammend the foxpro tables.
> I can creating a record in a table so long as i set "default" values in the table.
> foxpro_table.rowset.beginedit()
> foxpro_table.rowset.fields["Numeric field"].value = 0
> foxpro_table.rowset.fields["charcter_field"].value = ""
> foxpro_table.rowset.save()
>
> however i cannot create a record if the table contains memo fields because i cannot assign a default value with
>
> foxpro_table.rowset.fields["memo_field"].value = ""
>
> I get the following message when i try to create a new record in the table.
>
> Server Error: [Microsoft][ODBC Visual FoxPro Driver]Field COMMENTS does not accept null values.


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com