NetTalk Central

Author Topic: p_web.openfile  (Read 3692 times)

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
p_web.openfile
« on: August 02, 2017, 12:21:59 PM »
Hi,
In a form procedure I have a openfile routine which looks like:

OpenFiles  ROUTINE
! Start of "Beginning of Procedure, Before Opening Files"
! [Priority 5000]

! End of "Beginning of Procedure, Before Opening Files"
  p_web.OpenFile(Groep)
  p_web.OpenFile(SQLFILE)
  p_web.OpenFile(Account)
  FilesOpened = True
! Start of "Beginning of Procedure, After Opening Files"
! [Priority 5000]

! End of "Beginning of Procedure, After Opening Files"

However, when I use embedded sql  (sqlfile{prop:sql} = 'sql-statement' ),  an error message occurs stating that the file is NOT open.
To make it work I have to use the access:sqlfile.openfile() command

Is this normal behaviour? If it is, no problem. I know the work around. If it is not, what is a/the solution.


Cheers,
Rene
Rene Simons
NT14.14

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: p_web.openfile
« Reply #1 on: August 03, 2017, 10:41:58 PM »
The form is an event handler, so it enters and exits many times.
the existence of this routine does not mean it is called (and mostly is not called.)

When using file you should always open and close them yourself.

cheers
Bruce

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: p_web.openfile
« Reply #2 on: August 04, 2017, 01:42:18 AM »
Ok, fine,
Cheers,
Rene
Rene Simons
NT14.14