NetTalk Central

Author Topic: Creating a control record - form  (Read 7155 times)

sabra

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • Email
Creating a control record - form
« on: December 28, 2010, 12:32:55 PM »
Hi All,
For me a control record typically is a (tps) file with just one record and has all kind off control field and settings e.g. the name of the smtp server. I took me some time to access the record from a menu. My table has just one key (pksysid) with just one field (with the name ID) which has the value of 1 The prefix of the file is WBC (web control)
- create a form  , use the pksysid key as access key
- In the menupoint call the form with the URL e.g. 'UpdWebconfig?&wbc__id=1&Change_btn=Change&'
- &wbc__id=1 tells the form to retrieve the record by fetching the record with wbc:id=1
- &Change_btn=Change& tells to call the form in change mode
Unfortunaly this did not work for me and i want to share my mistakes with you!
In the dct :
- I did not tick the primary key and require unique value option ON (i leave the other ones unticked)
- I used a byte for the ID field
Then in the form:
- i changed the default action from 'change' to none (Change_btn) does the work (?)
After these changes it worked.

to get the first record into the table i use the
'before menu item 'embed of the 'configure'menu option.

! config record check
wbc:id = 1
if access:webconfig.fetch(wbc:pksysid)
  P_WEB._TRACE('Error getting config record'& errorcode() )
  wbc:id = 1
  access:webconfig.insert()
end

I can't see that the file is opened actualy but is works (abc access: opens it readonly??))


Maybe someone else can answer this last question .

Best Regards,

Walter van der Horst
The Netherlands

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: Creating a control record - form
« Reply #1 on: December 28, 2010, 10:48:37 PM »
If you're not sure if the file is open, then I recommend explicitly opening it using
Access:FileName.Open()
Access:FileName.UseFile()
...
Access:FileName.Close()