NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Rene Simons on August 02, 2017, 12:21:59 PM

Title: p_web.openfile
Post by: Rene Simons 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
Title: Re: p_web.openfile
Post by: Bruce 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
Title: Re: p_web.openfile
Post by: Rene Simons on August 04, 2017, 01:42:18 AM
Ok, fine,
Cheers,
Rene