Page 1 of 1

cGetFile( )

Posted: Fri Feb 12, 2021 12:31 am
by TimStone
A quick question:

Consider the following line of code: cQBFile := cGetFile( "QuickBooks|*.QBW", "Select your Quick Books Company file")

In the past it would give me the link to the file. Something changed ( likely in Windows ). However, Windows pops up a box that informs me the file is in use by another program and I need to close it or select another file. I cannot close it because it must be open in order to setup the QBFC interface between my application and QuickBooks.

I'm trying to update some old code that no longer works ... and I suppose there is a flag I need to set to allow me to grab this file. IN Quickbooks, it is already set in multi-user mode so this should be allowable.

Your thoughts will be appreciated.

Tim

Re: cGetFile( )

Posted: Fri Feb 12, 2021 3:07 am
by nageswaragunupudi
This message indicates that the file is already open "exclusively" by another application or even by our own application.
IN Quickbooks, it is already set in multi-user mode so this should be allowable.
Even then, if any application already opened the file in exclusive mode, we can not open it again.

Consider this simple example

Code: Select all

USE STATES NEW EXCLUSIVE
USE CUSTOMER NEW SHARED
cFile := cGetFile( "*.dbf|*.dbf|" )
 
In this case, cGetFile() function allows us to select customer.dbf but not states.dbf.

Re: cGetFile( )

Posted: Fri Feb 12, 2021 6:54 pm
by TimStone
I realize why the error is occoruing ... I will try a different post regarding the issue.

My question was to find a different way to just get the file name, not to open it.