Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clipper exe fails to open dbf running on win2000

Status
Not open for further replies.

socalwiz

Programmer
Jun 8, 2000
13
US
I have a DOS app (clipper 5.3 blinker 4.0) that has been running fine. Now I am informed it is not working. Upon selection of function, program errors out with DBFNTX 1002 -not able to open file. Problem is the line of code just before the use line is "copy stru extended to &t_file". This line does not produce the &t_file dbf to use. Can anyone suggest why this would stop working and maybe some fixes for it. thanks

socalwiz
 
Sorry for the confusion, The Thread title should read Clipper App fails to open dbfs running of win2000.
 
Make sure you have enough file handles allocated in your "files=" statement in your lnk file or your config.*

DBFNTX/1002 Open error (.dbt)

Explanation: The specified memo (.dbt) file could not be opened.

Action: Some suggestions to resolve the problem are:

1. Check to make sure that the specified file exists. If the file is
not in the directory where the application runs, use SET DEFAULT or
SET PATH to make the file accessible, or specify the full path name
where the file can be found.

2. In a network environment, make sure the application has the necessary
rights to access the file. If the file is available only for read
access, use the READONLY clause on the USE command.

CA-Clipper's default error handler (Errorsys.prg) will set NETERR()
to true (.T.) and will ask DBFNTX to default if the error was due to
a sharing violation on the network.

See Also: USE command, "Network Programming" chapter in the
Programming and Utilities Guide

Sam
 
Sam, thank you. All of these have been tried. The problem turns out to be that the program will not perform the line of code that reads "copy stru extended to (name of file). Any suggestions for help on this will be greatly appreciated.

socalwiz
 
I generally use the form

Code:
COPY TO TEMP\MYFILE STRU EXTENDED

or

COPY TO ("D:\TEMP\MYFILE") STRU EXTENDED

It works very well.

In addition to the thoughts of others above, I would look at your Clipper file settings - they may be too close to the bone.


Clipper can pick up the number of files it is supposed to open from either an environment variable or from a 'burnt-in' value (if you have a linker that supports it - and blinker does).

To 'burn' it into the executable you will need a line that looks like this:

Code:
BLINKER EXECUTABLE CLIPPER F225;E0;

In your link file.

So, if you've done all the 'files' things in your machine config, which for Windows 2K is probably just a question of changing the files=40 line (at the bottom of either c:\winnt\system32\config.nt or c:\windows\system32\config.nt) to say files=255 , you should be good to go!


good luck


Regards

Griff
Keep [Smile]ing
 
What I use regularly to create a new database with the structure from another is the following code snippet which is using a dbf (PS)using Flexfile (DBV) fields to a DBT structured file (PS_1).

Code:
Use PS VIA "FlexFile" NEW

aDbf := PS->(DBSTRUCT())

dbcreate('PS_1', aDbf, 'DBFNTX')

Use PS_1 NEW

dbselectarea('PS')

If the file is already opened that you want to duplicate then use this:

Code:
dbselectarea('PS')

aDbf := PS->(DBSTRUCT())

dbcreate('PS_1', aDbf, 'DBFNTX')

Use PS_1 NEW

dbselectarea('PS')

Be sure to include:

#include 'DBSTRUCT.CH'

Hope this helps

Sam
 
One other thought, is your 'name of file' MSDOS compliant?

It (and it's path) will need to be the 8.3 format.

Regards

Griff
Keep [Smile]ing
 
Griff, thanks for the help.

Everything you have suggested has or is being tried. I have even check the properties of the folder to where the files are kept for anything strange. I have put some pointing lines of code in the prg just to see where it was going. they go like this

select 0
use &ent_file alias uset_db

@10,0 say "I'm using &ent_file"
inkey(1)

if .not. file ("&t_file")
@11,0 say 'i'm here'
inkey(1)

copy stru extended to &t_file
close
endif

if .not. file ("&t_file")
@12,0 say "BOO"
inkey(1)
else
@12,0 say "Hurray"
inkey(1)
endif

I always get:
"I'm using &ent_file"
'i'm here'
"BOO"

This code has worked for almost a year now without a hitch. I do not know if the system administrators have made any changes to the pc's or not. If you can come up with any suggestions as to why this would stop working I sure would be greatful.

thanks
socalwiz
 
Socalwiz,
Has some administrator changed the permissions on your folder and taken away the permission to create a file?

Regards,
David.
 
Hi

Code:
SELECT 0
USE (ENT_FILE) ALIAS USET_DB

@ 10,0 SAY "I'm using [" + ENT_FILE+ "]"
INKEY(1)

IF .NOT. FILE (T_FILE)
	@ 11,0 SAY "i'm here"
	INKEY(1)
	COPY STRU EXTENDED TO (T_FILE)
	CLOSE
ELSE
	@ 12,0 SAY "WHAT HAPPENS HERE?"
ENDIF

IF .NOT. FILE (T_FILE)
	@ 13,0 SAY "BOO"
	INKEY(1)
ELSE
	@ 13,0 SAY "Hurray"
	INKEY(1)
ENDIF

Try this code first.

Regards

Griff
Keep [Smile]ing
 
Griff's little prog looks like a good test. The DBFNTX 1002 error has to do with opening a .DBT file (memo file). The structure extended file does not have memo fields, so no .DBT. Consequently I don't think the problem lies with creating that file, but rather with opening the input file, which presumably does have a .DBT file.

Is the .DBT file there? Is it read only? Does the user have read/write permission on that file?

Anyway, Griff's test should provide some answers.

Jock
 
All, The test failed. with the same results as before
I always get:
"I'm using &ent_file"
'i'm here'
"BOO"


These are settings being used:
config.nt = files=255
set clipper= V100; R224; F225;
Blinker exe F225; E0;
Procedure depth = 60
overlay opsize = 90

I talked to admin and no changes have been made to security rights.

If anyone can come up with some suggestions that might help I would be very greatful.

thanks

socalwiz
 
Hi Socal - you can't have gotten that series from the code I posted.

The "I'm using &ent_file" line has been replaced and would produce something like:

Code:
I'm using [myfile]





Regards

Griff
Keep [Smile]ing
 
Griff

changed code again and this is the results

I'm using [NX6071LD.DBF]
'i'm here'
"BOO"

but is still does not create the file with the extended structure.

anything else to suggest
 
That's interesting.

Code:
SELECT 0
USE (ENT_FILE+".dbf") ALIAS USET_DB

@ 10,0 SAY "I'm using [" + ENT_FILE+ "]"
INKEY(1)

IF .NOT. FILE (T_FILE+".dbf")
    @ 11,0 SAY "i'm here"
    INKEY(1)
    COPY STRU EXTENDED TO (T_FILE)
    CLOSE
ELSE
    @ 12,0 SAY "WHAT HAPPENS HERE?"
ENDIF

IF .NOT. FILE (T_FILE+".dbf")
    @ 13,0 SAY "BOO"
    INKEY(1)
ELSE
    @ 13,0 SAY "Hurray"
    INKEY(1)
ENDIF

I actually think this is a file handles, or access rights problem - but can you try the code above?


Be warned file() is not a great function, it looks all through the vfp path to file the file...

use this function instead:

Code:
FUNCTION MYFILE
	PARAMETER m.FILENAME
	PRIVATE m.FILENAME,m.FLG
	M.FLG = .F.
	IF !EMPTY(m.FILENAME)
		IF ADIR(TMPDIRFILES,m.FILENAME) > 0
			M.FLG = .T.
		ENDIF
	ENDIF
	RETURN(m.FLG)


Regards

Griff
Keep [Smile]ing
 
Griff-

That last function of yours is FoxPro, isn't it?
 
Ah

Well

Yes, it is and can I claim the 'late night' exemption?

B-P

Regards

Griff
Keep [Smile]ing
 
Following on from my obviously *stupid* VFP comments.

It *might* be worth putting a little delay between the creation and the test for availability - on the assumption that the file is being 'checked out' by an anti-virus program....

Personally, I still think it's a no. of files or access rights thing... so how about this code?

Code:
SELECT 0
USE (ENT_FILE+".dbf") ALIAS USET_DB

@ 10,0 SAY "I'm using [" + ENT_FILE+ "]"
INKEY(1)

IF .NOT. FILE (T_FILE+".dbf")
    @ 11,0 SAY "i'm here"
    INKEY(1)
    COPY (T_FILE) STRU EXTENDED TO     CLOSE
    @ 11,0 SAY "i'm here after creating the extended file!"
    inkey(1)
ELSE
    @ 12,0 SAY "WHAT HAPPENS HERE?"
ENDIF

@ 13,0 say "Waiting for a it of support"
inkey(1)
IF .NOT. FILE (T_FILE+".dbf")
    @ 14,0 SAY "BOO"
    INKEY(1)
ELSE
    @ 14,0 SAY "Hurray"
    INKEY(1)
ENDIF

Regards

Griff
Keep [Smile]ing
 
See, the late night exemption would have solves the 'it' or 'bit' typo

B-)

Regards

Griff
Keep [Smile]ing
 
All, I want to thank you for your support. All has been fixed and program is now working properly again. Thanks again for the support.

socalwiz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top