Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DefaultValue
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Titre:
Divers
Thread ID:
00464751
Message ID:
00468949
Vues:
27
Hello Kevin
Thank you for your suggestion. I did as you recommended and this was the result:

First of all I notices that the “SEND SQL UPDATES” check box was not checked. So I checked it.

1. I opened the required database.

2. Used the view and appended a blank. I tried to browse the view but no matter what I tried I got a “CANNOT INSERT AN EMPTY ROW FROM A VIEW INTO ITS BASE TABLE” error. I replaced the key field (contractno) with 2000 using “REPL”. I could then browse the view, which had a blank record with a key field of 2000. When I closed the view with a “USE” and looked at the contracts table, a blank record with a key field of 2000 was there.

3. Note that it did not obtain the next unique id from the id table by using the newid().

4. While using the contracts table I appended a blank. When I browsed the table the new blank record with the next unique in the key field. So that works fine.

5. I ran the application and then the input form, which uses a page frame. When I clicked on the input the form in question. When I clicked the “NEW” button the first record of the list on the form had its key field (contracts) changed from “1” to “1654” the next unique ID. This immediately triggered “ERROR 11” the “=SETFLDSTATE” error.

Questions
1. What are the possible reasons for this problem?

2. Which function actually appends the blank in the business object?

3. I think it maybe the “ALLOWNEW()”, how ever I cannot find it <g>

4. Which phrase in the views program will cause the “SEND SQL UPDATES” checkbox to be checked?

I have attached a section of the “VIEWS.PRG” in case you can notice any errors. Thank you for your time your assistance is much appreciated. I am keen to visit you again soon to maybe do your advanced course. Have you released the next version of the Mere Mortals Framework yet?

P.S. Sorry for the gigantic size of this email <g>

Regards Allan

CREATE SQL VIEW lv_contview AS ;
SELECT Contracts.*;
FROM contapp!contracts ;
ORDER BY Contracts.contractno

DBSetProp('LV_CONTVIEW', 'View', 'UpdateType', 1)
DBSetProp('LV_CONTVIEW', 'View', 'WhereType', 1)
DBSetProp('LV_CONTVIEW', 'View', 'FetchMemo', .T.)
DBSetProp('LV_CONTVIEW', 'View', 'SendUpdates', .T.)
DBSetProp('LV_CONTVIEW', 'View', 'UseMemoSize', 255)
DBSetProp('LV_CONTVIEW', 'View', 'FetchSize', 100)
DBSetProp('LV_CONTVIEW', 'View', 'MaxRecords', -1)
DBSetProp('LV_CONTVIEW', 'View', 'Tables', 'contapp!contracts')
DBSetProp('LV_CONTVIEW', 'View', 'Prepared', .F.)
DBSetProp('LV_CONTVIEW', 'View', 'CompareMemo', .T.)
DBSetProp('LV_CONTVIEW', 'View', 'FetchAsNeeded', .F.)
DBSetProp('LV_CONTVIEW', 'View', 'FetchSize', 100)
DBSetProp('LV_CONTVIEW', 'View', 'Comment', "")
DBSetProp('LV_CONTVIEW', 'View', 'BatchUpdateCount', 1)
DBSetProp('LV_CONTVIEW', 'View', 'ShareConnection', .F.)

*!* Field Level Properties for LV_CONTVIEW
* Props for the LV_CONTVIEW.contractno' field.
*DBSetProp('LV_CONTVIEW.contractno', 'Field', 'PrimaryKey', .T.)
DBSetProp('LV_CONTVIEW.contractno', 'Field', 'KeyField', .T.)
DBSetProp('LV_CONTVIEW.contractno', 'Field', 'Updatable', .T.)
DBSetProp('LV_CONTVIEW.contractno', 'Field', 'UpdateName', 'contapp!contracts.contractno')
DBSetProp('LV_CONTVIEW.contractno', 'Field', 'DataType', "I")
*removed as duplicates visit to newID()
*DBSetProp('LV_CONTVIEW.contractno', 'Field', 'DefaultValue', 'newid()')
* Props for the LV_CONTVIEW.contname field.
DBSetProp('LV_CONTVIEW.contname', 'Field', 'KeyField', .F.)
DBSetProp('lv_contview.contname', 'Field', 'Updatable', .T.)
DBSetProp('LV_CONTVIEW.contname', 'Field', 'UpdateName', 'contapp!contracts.contname')
DBSetProp('LV_CONTVIEW.contname', 'Field', 'DataType', "C(50)")
* Props for the Lv_contview.titlename field.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform