Some Inquiries on Visual FoxPro 
Author Message
 Some Inquiries on Visual FoxPro

I just have some more questions on Visual FoxPro.
I really hope someone could help me with them.

1. Is there a way to print reports such that each page would have a footer
that say PAGE <current page> OF  <total number of pages> ?

2. Is there a way to protect the data in tables, for example, preventing
users from manually opening the tables through VFP or another program when
it is a part of a custom VFP applicaiton.



Wed, 17 Jul 2002 03:00:00 GMT  
 Some Inquiries on Visual FoxPro
Hi Hamilton,


Quote:
> I just have some more questions on Visual FoxPro.
> I really hope someone could help me with them.

> 1. Is there a way to print reports such that each page would have a footer
> that say PAGE <current page> OF  <total number of pages> ?

In the Footer add a field - "Page "+ALLT(STR(_pageno))+" of
"+ALLT(STR(npagecount))

Now run the report twice via a PRG. The first time will create an
appropriate value for nPageCount and the second will actually print the
report. Here is the code:

npagecount=0

* this will figure a value for the last page, which is stored in the
report's public variable - _pageno
REPORT FORM <reportname> NOCONSOLE
npagecount=_pageno
REPORT FORM <reportname> TO PRINT

Quote:

> 2. Is there a way to protect the data in tables, for example, preventing
> users from manually opening the tables through VFP or another program when
> it is a part of a custom VFP application.

If all of your tables will be in a dbc, you can get some security from
outside ODBC snoopers by creating your dbc in code every time you start your
program and erasing it on exit from your program. You create the dbc in code
via Gendbc.prg, which ships with VFP. Here are the basic steps:

Create your dbc and add all of your Tables, Views, etc. (say Mydbc.dbc)
Back it up for safety's sake
Run Gendbc.prg against this dbc. It will create a PRG with the name of your
dbc. i.e. Mydbc.prg
You can now recreate the dbc by running this PRG.

In your startup program for the app, create the dbc - DO Mydbc
In your closeup routine, once you have closed the dbc, erase the dbc files
(.DBC, .DCX, .DCT)

Your DBF files will contain a reference to the dbc, which only exists while
your application is active, and can not be viewed via ODBC. However, a
person with VFP could open the table by severing the link to the dbc.

Best regards,
Tom



Wed, 17 Jul 2002 03:00:00 GMT  
 Some Inquiries on Visual FoxPro
For adding security to the various tables, you can even do some file
operations with fopen etc..

Look up the file structure for a dbf file and use one or two or any number
of the bytes in the file header  and encrypt them. You will have to decrypt
them before use and encrypt again when not in use. Might pose a bit of a
problem in multi user mode implementing it.
But works fine for single session apps.

Best regards,
Ramesh Madhupalli


Quote:
> Hi Hamilton,



> > I just have some more questions on Visual FoxPro.
> > I really hope someone could help me with them.

> > 1. Is there a way to print reports such that each page would have a
footer
> > that say PAGE <current page> OF  <total number of pages> ?

> In the Footer add a field - "Page "+ALLT(STR(_pageno))+" of
> "+ALLT(STR(npagecount))

> Now run the report twice via a PRG. The first time will create an
> appropriate value for nPageCount and the second will actually print the
> report. Here is the code:

> npagecount=0

> * this will figure a value for the last page, which is stored in the
> report's public variable - _pageno
> REPORT FORM <reportname> NOCONSOLE
> npagecount=_pageno
> REPORT FORM <reportname> TO PRINT

> > 2. Is there a way to protect the data in tables, for example, preventing
> > users from manually opening the tables through VFP or another program
when
> > it is a part of a custom VFP application.

> If all of your tables will be in a dbc, you can get some security from
> outside ODBC snoopers by creating your dbc in code every time you start
your
> program and erasing it on exit from your program. You create the dbc in
code
> via Gendbc.prg, which ships with VFP. Here are the basic steps:

> Create your dbc and add all of your Tables, Views, etc. (say Mydbc.dbc)
> Back it up for safety's sake
> Run Gendbc.prg against this dbc. It will create a PRG with the name of
your
> dbc. i.e. Mydbc.prg
> You can now recreate the dbc by running this PRG.

> In your startup program for the app, create the dbc - DO Mydbc
> In your closeup routine, once you have closed the dbc, erase the dbc files
> (.DBC, .DCX, .DCT)

> Your DBF files will contain a reference to the dbc, which only exists
while
> your application is active, and can not be viewed via ODBC. However, a
> person with VFP could open the table by severing the link to the dbc.

> Best regards,
> Tom



Sat, 20 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. OBCD for Mac Visual Foxpro 3 to read Visual Foxpro 5 databases

2. Developer Inquiry

3. Further inquiry: Question:structural vs non-structural index

4. Visual FoxPro vs Visual Basic vs C++...

5. Convert report from visual foxpro 6 to visual foxpro3

6. convert visual foxpro to visual basic

7. Visual FoxPro 5.0 and Visual Basic 5.0

8. Visual FoxPro 2.6 Printing vs Visual 5.0 Printing

9. Visual UML 2.06 - Visual FoxPro Interface

10. Visual FoxPro calling Visual Basic - Help

11. visual c++ and visual foxpro

12. Different between Visual Studio and Visual Foxpro 5.0

 

 
Powered by phpBB® Forum Software