Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Field does not accept null values
Message
De
26/02/1998 10:16:04
 
 
À
26/02/1998 10:09:21
Steve Camsell
Windmill Associates
Bath, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00081366
Message ID:
00081371
Vues:
31
>This is probably extremely basic: I am trying to create a new customer. A customer consists of two records at the back end, one called Customer and one called PsnlDets (as in Personal Details). They have a 1 to 1 relationship and are joined by iCust_id.
>
>I have therefore created a view which joins the two records together, and I have made this updateable. The SQL for the view is as follows:
>
>
>SELECT Customer.icust_id, Customer.csearchname, Customer.cacct_ref,;
>  Customer.lmailpref, Customer.ccredit_info, Customer.mnotes,;
>  Customer.lcorp_indiv, Customer.ycredit_limit, Customer.ycredit_balance,;
>  Customer.icurrency, Customer.istatus, Customer.ivat_status,;
>  Customer.drec_added, Psnldets.icust_id, Psnldets.lgender,;
>  Psnldets.ctitle, Psnldets.csurname, Psnldets.ddob, Psnldets.drec_added,;
>  Customer.imedia_id, Psnldets.cforenames;
> FROM customer Customer, psnldets Psnldets;
> WHERE Customer.icust_id = Psnldets.icust_id;
>   AND Customer.icust_id = ?pnCust_id
>
>
>I key in any value for a pnCust_id and then add a new record to the view. When I try to commit my new record, I get the following error :
>
>Connectivity error: [Microsoft][ODBC Visual FoxPro Driver]Field iCust_id does not accept null values.
>
>
>Even when I populate the iCust_id field in the view I still get the same error. Can anyone tell me what is going on here, or preferably, whether I am going about this the wrong way?

The first suggestion is to remove Psnldets.icust_id from field list, just because it's redundant (you have Customer.icust_id already). Another question is about your setting. The error message indicates that you use Remote View again VFP data. Is it right? Could you use Local view?
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform