Using dbf on windows mapped drive

323 views
Skip to first unread message

Raymond

unread,
Sep 6, 2019, 9:35:14 PM9/6/19
to Harbour Users
Hi,

I need help in understanding what is preventing me from using tables on network mapped drive & how to resolve it.

I have successfully used hp_processRun() to map a remote Linux server samba drive under Windows 10 using plink. I can browser the drive using Windows' File Explorer.
I make sure that the mapping exist by looping until File("\\10.0.0.1\table.dbf") returns True.

I have mapped 10.0.0.1 to R: which is successful as I can access R: after this.
I have tried SET DEFAULT TO R:\
I have also tried SET PATH TO "\\10.0.0.1"

But dbUseArea(.T.,, "table") always returned False.

I am out of ideas. Please help.

Thanks,
Raymond

Peter Rees

unread,
Sep 6, 2019, 11:55:57 PM9/6/19
to Harbour Users
Hi Raymond,

Make sure that you have Read Write access to the share. Try copying a file to the share (any file will do) and see if it allows the file to be copied

Regards

Peter

Raymond

unread,
Sep 7, 2019, 10:30:36 AM9/7/19
to Harbour Users
Hi Peter,

Indeed the share was read only when mapped on Windows.
I changed the sharing & now I can create & delete both folder & file on Windows' mapped drive.

However, I still do not have success in using dbUseArea()

I tried the following combinations:
1. DOS Error 3
SET DEFAULT TO R:
SET PATH TO \

2.
SET DEFAULT TO R:
SET PATH TO "\\10.0.0.1"

3.
SET PATH TO "\\10.0.0.1"

4.
SET DEFAULT TO R:

2,3 & 4 did not return any error for dbUseArea(), but gives "Alias does not exist" when I try to do Table->(dbSetOrder(1)).

Thanks,
Raymond




Brunello Pulix

unread,
Sep 8, 2019, 3:06:35 AM9/8/19
to Harbour Users

"\\10.0.0.1" is not a path
test:
  "\\10.0.0.1 \ c:"
or
  "\\10.0.0.1 \ c:\ Test"

Brunello


Raymond

unread,
Sep 8, 2019, 9:53:14 PM9/8/19
to Harbour Users
Hi Brunello,

I get DOS error 16 Open error: \\10.0.0.1\R:\Table.dbf using the following path:
SET PATH TO "\\10.0.0.1\R:"
dbUserArea(.T.,, "\\10.0.0.1\R:\table"

My remote server is a Linux so there is no particular drive I can specify.

Even though R: has been successfully mapped on Windows, using dbUseArea(.T.,, "R:\Table") will still fails with DOS error 3.

Thanks,
Raymond

Gerald Drouillard

unread,
Sep 9, 2019, 10:27:47 AM9/9/19
to harbou...@googlegroups.com
On Sun, Sep 8, 2019 at 9:53 PM Raymond <ray...@gmail.com> wrote:
Hi Brunello,

I get DOS error 16 Open error: \\10.0.0.1\R:\Table.dbf using the following path:
SET PATH TO "\\10.0.0.1\R:"
dbUserArea(.T.,, "\\10.0.0.1\R:\table"

My remote server is a Linux so there is no particular drive I can specify.

The file or directory will have to be shared somehow with the client machine.  If the client is windows then you will have to have samba running on the server.  If you have the share setup properly on the server you should be able to see it when you goto
\\10.0.0.1
in windows file explorer
I doubt it is called "R:"

Ash

unread,
Sep 9, 2019, 10:40:01 AM9/9/19
to Harbour Users
Hello Raymond,

I am accessing a Linux server from Windows where a folder \bms is mapped to r:. Try this:

FUNCTION main()

LOCAL datapath := 'r:\'

// Defaults to DBFNTX 
USE datapath + 'table'
Browse()

RETURN nil

Regards.
Ash

Raymond

unread,
Sep 10, 2019, 11:06:08 AM9/10/19
to Harbour Users
Hi Ash,

It looks like there's something wrong with my setup?

If I use the exact code you provided & compile it with hbmk2: \dev\hb32\bin\hbmk2 test, I get an error:
Error E0030 Syntax error at 'MAIN'

I have to remark the 1st line & change the USE statement to USE ( datapath + 'Table' ) to compile successfully.

If drive R: is not mapped, running test.exe gives DOS Error 53 Open Error r:\Table.dbf

If drive R: is mapped, test.exe just runs thru & returns back to the command prompt without doing Browse() & no error as well.

Thanks,
Raymond

Raymond

unread,
Sep 12, 2019, 10:14:00 AM9/12/19
to Harbour Users
This is what I currently have:

test.hbp
~~~
xhb.hbc
test
~~~

test.prg
~~~
#include "hbgtinfo.ch"
#include 'inkey.ch'

REQUEST DBFCDX
RDDSETDEFAULT( "DBFCDX" )

FUNCTION Main()

LOCAL datapath = 'r:\'

USE ( datapath + 'Table' )
Browse()

RETURN NIL
~~~

I can compile successfully & test.exe get generated using this command:
\dev\hb32\bin\hbmk2 test -comp=mingw

When I run test.exe, the Command Prompt screen blinks & returns me back to the prompt immediately.

Raymond

unread,
Sep 12, 2019, 10:26:34 AM9/12/19
to Harbour Users
When I recompile test without the "datapath" variable & copy test.exe to R:\, it does the same thing, blink.

But when I copied Table.dbf from R:\ to local drive & run test.exe, I get to browse the table.

It looks like my remote Linux server Samba sharing is not proper.
Can someone share your exiting working Samba sharing setup. I would very much appreciate it.

Thank you.

Ash

unread,
Sep 12, 2019, 4:26:48 PM9/12/19
to Harbour Users
Hello Raymond,

Can you create a text file in r:\ folder?

Regards.
Ash

Raymond

unread,
Sep 14, 2019, 6:29:05 AM9/14/19
to Harbour Users
Hi Ash,

Yes. I can read & write in the folder as well as create & delete files.
I copied my test.exe from C: to R:\ & ran it after changing to R:
I then ran test.exe on R: & it paused for a short while (about 25 sec) before returning the command prompt to me.

Thanks,
Raymond
Reply all
Reply to author
Forward
0 new messages