USE a table over a network? (revised: not actually a network issue)

This forum is meant for questions about the Visual FoxPro Language support in X#.

User avatar
kevclark64
Posts: 127
Joined: Thu Aug 15, 2019 7:30 pm
Location: USA

USE a table over a network? (revised: not actually a network issue)

Post by kevclark64 »

Is there a problem with using a DBF file that's on a network drive? I have no problem with USE when the table is on a local drive, but when the table is on a network drive the program just stops and never gets past the USE line. I wanted to check the data in XSharp.RuntimeState.GetInstance() but the Watch window freezes on the USE line as well.
RGreim4XS
Posts: 41
Joined: Sat Feb 08, 2020 7:47 am

USE a table over a network?

Post by RGreim4XS »

HI Kevin, had the same fun with VFP inside a company network.
Can u open the files via win explorer ?
Did you use UNC notation ?
See : vfp wiki Vfp Unc,
Sometimes its also a permission issue.
HTH
Rainer
User avatar
kevclark64
Posts: 127
Joined: Thu Aug 15, 2019 7:30 pm
Location: USA

USE a table over a network? (revised: not actually a network issue)

Post by kevclark64 »

Turns out I jumped to a hasty conclusion thinking it was a network problem. It actually has something to do with files being in a particular database container. If I create a table on the network drive but do not put it in the database container then I can open it. If it's in the database container then I found it actually does open after a very long time, between 5 and 10 minutes. it's not a problem with all database containers because I can create a new database, put files in it, and open those files without a problem. The particular database container that is a problem has a very large number of tables in it (several thousand) so maybe that's the issue, or maybe something else about the container is causing the issue.
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

USE a table over a network? (revised: not actually a network issue)

Post by Karl-Heinz »

Hi Kevin,

i connected to a Win7 VM and opened a DBF via a UNC path. It works when i use the "DBFNTX" or "DBFCDX" driver, but it fails with a exception if the "DBFVFP" driver is used. The error message means "illegal path char". very strange ...

Code: Select all

Unbehandelte Ausnahme: XSharp.Error: Illegales Zeichen im Pfad. ---> System.ArgumentException: Illegales Zeichen im Pfad.
   bei System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)
   bei System.IO.Path.Combine(String path1, String path2)
   bei XSharp.RDD.DBFVFP._ReadDbcInfo()
   bei XSharp.RDD.DBFVFP.Open(DbOpenInfo info)
   bei XSharp.CoreDb.<>c__DisplayClass112_0.<UseArea>b__0()
   --- Ende der internen Ausnahmestapelüberwachung ---
   bei XSharp.RT.Functions.DoError(String cSymFunc, Int32 nTries)
   bei XSharp.RT.Functions.DbUseArea(__Usual[] Xs$Args)
   bei FoxNetOpen.Exe.Functions.Start() in C:XIDEProjectsProject1ApplicationsFoxNetOpenPrgStart.prg:Zeile 16.
Do you see the same exception if a UNC path is used ?

Code: Select all

FUNCTION Start( ) AS VOID
LOCAL cDbf, cPath AS STRING  
 
//	RddSetDefault ( "DBFCDX" )     
	
	RddSetDefault( "DBFVFP")
	
 
	cPath := "WIN-005LK3HMQOVwin7xsharp"	


	cDBF := cPath + "Text.dbf" 
	
	USE (cDBF) NEW ALIAS TEST
//	DbUseArea(TRUE, , cDBF , "TEST" ) 
	
	IF Used()

	
		DO WHILE ! Eof()
			
			? test->text1 			

			SKIP 1			
			
		ENDDO 
   	
		USE
	
		
	ENDIF 	



RETURN
regards
Karl-Heinz
User avatar
robert
Posts: 4558
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

USE a table over a network? (revised: not actually a network issue)

Post by robert »

Kevin,

This build has very "primitive" DBC support. All we do is to locate the table in the DBC and read the "long" field names from the DBC. This was necessary because sometimes these long names are used in index expressions
We will add full DBC support (and faster DBC support) in one of the next builds.
Robert

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
User avatar
kevclark64
Posts: 127
Joined: Thu Aug 15, 2019 7:30 pm
Location: USA

USE a table over a network? (revised: not actually a network issue)

Post by kevclark64 »

Karl-Heinz, I can open a DBF file using a UNC path with no problem.
Karl-Heinz
Posts: 774
Joined: Wed May 17, 2017 8:50 am
Location: Germany

USE a table over a network? (revised: not actually a network issue)

Post by Karl-Heinz »

Hi Kevin,

seems you´re not using the latest 2.3 version, right ?

The build 2.3 seems to throw an "illegal path char" exception no matter if it´s a UNC path or a drive letter path. I installed the previous build "2.2 a" and there are no such "DBFVFP" path problems. I´ll put the pieces together and open a ticket.

regards
Karl-Heinz
RGreim4XS
Posts: 41
Joined: Sat Feb 08, 2020 7:47 am

USE a table over a network?

Post by RGreim4XS »

Hi, what comes also into my mind. The topic about handling upper and lower case. In older XBASE it was always handled as upper. Then I have updated VFP9 with the fixes VFPA, and nothing works, because now is everything case sensitive.
HTH
Rainer
User avatar
kevclark64
Posts: 127
Joined: Thu Aug 15, 2019 7:30 pm
Location: USA

USE a table over a network? (revised: not actually a network issue)

Post by kevclark64 »

Karl-Heinz, I am using version 2.3. (I know that for a certainty because I can use THEN after IF which threw a compiler error in 2.2.)

The following line works with no problem:
use "ignatius2foxpromasterlistdbasetest-file2.dbf" new shared

It works as well to open from a local drive using a drive letter:
use "e:fpd26sqltest.dbf" new shared

Kevin
User avatar
robert
Posts: 4558
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

USE a table over a network? (revised: not actually a network issue)

Post by robert »

Karl Heinz,
can you send me the DBF and DBC file where you see this problem ?

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply