FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC Use file from Network Drive with Shared
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Use file from Network Drive with Shared
Posted: Sat Sep 02, 2006 10:23 PM

Dear All,

I've found the problem with open file from network drive with shared mode. How can I open it.

CURDIR() function is show

"Network\V4 on DUTCHEZ4"

I try to use this command but it doesn't work.

USE (CURDIR()+"\TEST") SHARED NEW

If I do not use SHARED, I can open it but not in shared mode

USE (CURDIR()+"\TEST") NEW

Best regards,
Dutch

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Use file from Network Drive with Shared
Posted: Sat Sep 02, 2006 11:08 PM

Dutch,

Are you using Windows Mobile 2005 ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Yes, WM5
Posted: Sun Sep 03, 2006 05:06 AM

Dear Antonio,

Yes, I use WM5 & HP IPAQ 2790. When I click on the program. It doesn't show anything but after I change my code to USE without SHARED or SHARE. The program is opened immediately.

Regards,
Dutch

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Use file from Network Drive with Shared
Posted: Sun Sep 03, 2006 05:59 AM

Dutch,

Is SHARED is blocking or slowing down the USE process on a real Pocket PC, you may consider to build your application without SHARED clause.

You may use a workaround, like using temporary DBFs, or an external file to use it as semaphore to know when to lock/unlock other files from the PC.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Use file from Network Drive with Shared
Posted: Sun Sep 03, 2006 07:58 AM

Dear Antonio,

You mean I have to USE an EXCLUSIVE mode. How can I open the shared file. May I have an example open file as SEMAPHORE?

Best regards,
Dutch

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Use file from Network Drive with Shared
Posted: Sun Sep 03, 2006 08:50 AM

Dutch,

> You mean I have to USE an EXCLUSIVE mode.

Yes. If Windows Mobile 2005 does not let you use the SHARED mode then you have no other choice.

> May I have an example open file as SEMAPHORE?

Very simple, you use an ascii file where you write the locked records info. i.e.: locks.txt where you have:
number of locks: 2
record 2300
record 3420

So before you are going to modify a record, you check locks.txt to see if your record is "locked". If not, then you increase the number of locked records and write the record number. When you are done, you modify locks.txt again to remove the locked record.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Use file from Network Drive with Shared
Posted: Sun Sep 03, 2006 08:55 AM

Dutch,

Another possible workaround is to simulate a kind of client/server schema. You may have a file named tolock.txt and there you write the record you want to lock, and an app in the pc locks it for you.

In other words, you give instructions to a server application that modify the database for you. You may also use sockets instead an ascii file to comunicate with the "server".

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
I do not understand
Posted: Sun Sep 03, 2006 09:00 AM

Dear Antonio,

I don't understand "Lock.Txt". If this file is a main transaction file, you cannot use in exclusive for sure. If not how can you request for a lock record because you don't know what is the record number to lock. I you say WM5 cannot open with SHARE, I think the middle application (interface module) is the way out.

Best regards,
Dutch

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Use file from Network Drive with Shared
Posted: Sun Sep 03, 2006 10:57 AM

Dutch,

> because you don't know what is the record number to lock.

RecNo()

> I you say WM5 cannot open with SHARE

According to Microsoft, Windows Mobile 2005 supports files sharing API functions, but as you report, you are experiencing troubles with it.

> I think the middle application (interface module) is the way out.

What is it the interface module ? Do you mean the client/server model I commented ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Use file from Network Drive with Shared
Posted: Sun Sep 03, 2006 11:22 AM

Dear Antonio,

No, Because I still use FW and Comix. I've plan to change database but not now.

> Recno() is means you have to open the database first but I cannot open with exclusive because everybody use the main transaction file.

The interface module means small program to communicate between PPC and Database on server. PPC will write a single database to request the information and Interface will read database on the server and return the information that PPC need. Another request is post transaction from PPC and Interface will post instead of PPC to database on server.

Best regards,
Dutch

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)

Continue the discussion