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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to effectively hide table from users

Status
Not open for further replies.

R17

Programmer
Jan 20, 2003
267
PH

what is the better way to hide a table from my users?

i tried "including" these tables in my project but i need to write to these tables so i get a "cannot update cursor".

i do not want to simply hide the table by changing it's properties. can anyone help me?

 
Check out this sample form.

DO form HOME()+"samples\solution\ffc\crypto"

Brian
 
Try a different location and different file extentions.
Nobody would think that file r_q748g4.x4e would be a vfp table that contains important data.

Rob.
 
It may help to know what the reason is behind wanting to hide the tables as well as the level of computer expertise your program's users have, as this may effect how workable a particular solution is for you.

In addition to the suggestions given, you could hold the tables/cdx/fpt files in another table in binary memo fields and read them out to the windows temp directory before you use them and save them back into the fields when your program was finished with them. It would give you something similar to what you were looking for when you added the tables to your compiled program.

Another thing that can be considered is changing the attributes of the table files to HIDDEN and/or SYSTEM. However, I take it from your "i do not want to simply hide the table by changing it's properties" that this is not something you want to do.

Slighthaze = NULL
craig1442@mchsi.com
"Whom computers would destroy, they must first drive mad." - Anon​
 


slighthaze,

i guess i should just change the table's attributes to hidden. guess there's really no other way to secure a table unless i put it in the database server.

thanks for your advice. =)
 
Hi

Almost every method suggested has its drawback and nothing is absolute. As slighthaze pointed out, it depends on the need, the users proficiency, the security required behind the data and.or just protecting not knowledgeable people playing with it and so on.

If you are using DBC containers, you can use triggers to return .f. for adding, appending and deleting, so no one can play with individual tables. The trigger should look for a global variable initialised in your application. For example, in the start of Main.Prg
PUBLIC lDBFpass
lDBFpass = .t.

In all your triggers, add code..

IF lDBFpass
** more check for validation as required
RETURN .t.
ELSE
RETURN .f.
ENDIF

This will make sure that data is available to users, but as read only.

Now, if you want to protect the data from visiblity, then you have to use encryption rules/alogorithms.

Hiding a table is not workable. What if when one user is working, another one wants it or tries to change the attribute? How to make sure that all closes going thru your closing routine to hide tables? What if the user reboots and then after re-starting, reaches for the files?... there are so many questions here.

:)


ramani :)
(Subramanian.G)
 
R17

Another solution might be (if you have a server, or a partition on a hard-disk), to put the tables in a section of the hard-disk (or server) that is protected by a password and when the application starts it will map the partition and issue the correct password and once it shuts down it will unmap the partition.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 

hi everyone thanks for all your replies. =)

ramani,

how can i can use triggers to return .f. for my DBC? is this the same with changing the attributes to read-only?

i need to simply log the users who edits the table, also the "before and after" of each record. i create a report for these tables at the end of each month. and i don't want my users to mess with these tables.

any more help?
 
HI
how can i can use triggers to return .f. for my DBC? Is this the same with changing the attributes to read-only?

To give you an eample,

1. In your Main.Prg at the beginning add the code..
PUBLIC lDbfPass
lDbfPass = .t.

2. Now open the Data Tab of the Project and click open the Stored procedures.
Add a function at the end of the Stored Procedures as given below.. and then save it.

FUNCTION canIallow
IF VARTYPE(lDbfPass)#"L" OR !lDbfPass
lDbfPass = .f.
ENDIF
RETURN lDbfPass

3. Now open the table belonging to the DBC,
Reach the Table TAB
The in the Insert Trigger, update Trigger, Delete trigger places (in all three) put the code
canIallow()

Save it and that is it.
Now you can open the table and see the data. But if you try to delete or update or modify, the trigger will return .f. and so foil the attempt. However, if you do thru your application, it will accept the changes.

This is not fool proof in that, that this is only a safety against accidents by not so knowledgebale people. Any one specific to spoil can destroy. It is like being able to delete a file, though cannot be seen or modify.

:)

ramani :)
(Subramanian.G)
 
This has come up several times and we have never found a good solution.

This question is for MIKE GAGNON
Mike said:
-------------------------------------------------
"R17
Another solution might be (if you have a server, or a partition on a hard-disk), to put the tables in a section of the hard-disk (or server) that is protected by a password and when the application starts it will map the partition and issue the correct password and once it shuts down it will unmap the partition.
Mike Gagnon"
-------------------------------------------------

How do you map the partition and issue the correct password and unmap later?

EVBCS
 
HI

To connect:
NET USE S: \\myServer\myDrive /USER:ramani password /YES

To disconnect:
NET USE S: /d

But remember this also has drawback, unless Mike is going to guide with something unique.

What happens when a user connects, and then with the application running, minimise that or whatever and switch to DeskTop and then proceed to use the directory already opened. So the next thing is to stop any other application while our application is running.. This will go on.

:)

ramani :)
(Subramanian.G)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top