INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Clipper exe fails to open dbf running on win2000

Clipper exe fails to open dbf running on win2000

(OP)
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

RE: Clipper exe fails to open dbf running on win2000

(OP)
Sorry for the confusion,  The Thread title should read Clipper App fails to open dbfs running of win2000.

RE: Clipper exe fails to open dbf running on 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

RE: Clipper exe fails to open dbf running on win2000

(OP)
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

RE: Clipper exe fails to open dbf running on win2000

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 Smileing

RE: Clipper exe fails to open dbf running on win2000

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

RE: Clipper exe fails to open dbf running on win2000

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 Smileing

RE: Clipper exe fails to open dbf running on win2000

(OP)
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

RE: Clipper exe fails to open dbf running on win2000

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

Regards,
David.

RE: Clipper exe fails to open dbf running on win2000

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 Smileing

RE: Clipper exe fails to open dbf running on win2000

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

RE: Clipper exe fails to open dbf running on win2000

(OP)
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

RE: Clipper exe fails to open dbf running on win2000

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 Smileing

RE: Clipper exe fails to open dbf running on win2000

(OP)
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

RE: Clipper exe fails to open dbf running on win2000

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 Smileing

RE: Clipper exe fails to open dbf running on win2000

Griff-

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

RE: Clipper exe fails to open dbf running on win2000

Ah

Well

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

B-P

Regards

Griff
Keep Smileing

RE: Clipper exe fails to open dbf running on win2000

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 Smileing

RE: Clipper exe fails to open dbf running on win2000

See, the late night exemption would have solves the 'it' or 'bit' typo

happy shades

Regards

Griff
Keep Smileing

RE: Clipper exe fails to open dbf running on win2000

(OP)
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

RE: Clipper exe fails to open dbf running on win2000

Ok, that sounds good but What was the deal?

RE: Clipper exe fails to open dbf running on win2000

(OP)
It turned out to be a redundent function call.  So what we did was to eliminate one of the calls.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close