Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Asp foxpro table update problem
Message
From
07/02/2002 15:36:34
 
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00616818
Message ID:
00616966
Views:
33
>i am having a problem with this piece of code,
>it is linking do a foxpro database but in this particular
>table there are about 18 fields. i only want to update these
>particular ones but i am getting an error saying that
>a field cannot be blank. the last line is one work around but
>i do not want to have 10 or so lines like the last every time
>i want to add to the table
>Cheers and thanks in advance
>~M
>P.S. it connects alright it is just the blank entries in the table
>the exact error message is
>
>Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
>[Microsoft][ODBC Visual FoxPro Driver]Field PER_DDATE does not accept null values
>
>
>
>permitRS.Open "permit", objConn, , adLockOptimistic, adCmdTable
>
> permitRS.AddNew
> permitRS.Fields("per_num") = newpermitnum
> permitRS.Fields("per_eng") = eppeng
> permitRS.Fields("per_edate") = eppdate
> permitRS.Fields("per_etime") = epptime
> permitRS.Fields("per_emt") = eppdh
> permitRS.Fields("per_bran") = eppbran
> permitRS.Fields("per_site") = eppsite
> permitRS.Fields("per_cce") = eppcost
> permitRS.Fields("per_deph") = " "
> permitRS.Update

You can check for a Null value with IsNull() and replace the values accordingly. For example:
If IsNull(eppeng) Then eppeng=""
Something like that, before assigning to rs fields.
Previous
Reply
Map
View

Click here to load this message in the networking platform