Solved

invisible row / hidden info in table

Posted on 1998-06-07
9
181 Views
Last Modified: 2010-04-04
I want to save some options within a table file, but the user may not see these options, so is it possible to make a whole record invisible in a dbgrid or in another way save some informations within a table file?
0
Comment
Question by:koger
  • 5
  • 3
9 Comments
 
LVL 1

Expert Comment

by:Edo082297
ID: 1351236
Hi Koger,
  Depending on what exactly the nature of the information is that you wish to hide, perhaps you could simply put a creative filter on the table that would effectively 'hide' the record?   Another idea would be to store the options somewhere else, like in the registry.

HTH

Edo
0
 
LVL 1

Expert Comment

by:Marcius
ID: 1351237
Hi Koger,

I need to clear a few things up here. You want to store a record which contains options inside a table which contains other data unrelated to the options ? This sounds like a very strange thing to be doing... Do you mean that you want to have a column within the table which is used to store options ?

If that is the case, then you need to define persistant fields within you dataset for the information you want to display. Then create columns within the DBGrid and set the columns to display the fields. If this is what you are intending to do, let me know and I will provide more information.
0
 

Author Comment

by:koger
ID: 1351238
To Marcius
Yep, I don't see why it is so strange to store options in a table, but anyway let me see what you wanted to show me.
0
 
LVL 1

Expert Comment

by:Marcius
ID: 1351239
Sorry Koger, it is not strange to store options in a table. What is strange, is to store options is an *unrelated table*. You said that the options would be represented as a ROW, and I think that you mean a COLUMN. That is where the confusion come from.

Example table is like this:

MyTable (
  Name Varchar(40),
  Address Varchar(60),
  Options Varchar(10)
);

1. Open the fields editor for you dataset (double click on the TTable or TQuery etc)
2. Right click to bring up the menu, select add fields
3. Select all the field you require and then click OK.
4. You have now created persistant fields
5. Double click on your DBGrid to open the columns editor
6. Right click to open the menu and select add
7. Add as many columns as you need, in the example, add two columns. One for name and one for address
8. For each column created, set the fieldname property e.g name

So, when you run your application, only those fields for which you have created columns will be displayed in the DBGrid. You will be able to access the rest of the fields in the normal way (e.g FieldByName), or directly by referring to the persistant field (MyClientDatasetADDRESS.Value).
 
I hope this solves the problem. Let me know if you require any additional information :)
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:koger
ID: 1351240
Hi Marcius
Sorry my mistake as you said I meant to store the informationen in a column, but lets say I use 5 rows of this hidden column, these 5 rows will still be showed in the dbgrid, even if all the visible cells are empty, because the table contains 5 rows. It is these 5 rows I want to hide, if it is possible without using filter.
0
 
LVL 1

Expert Comment

by:Marcius
ID: 1351241
Let me confirm, you want to show an empty DBGrid when you have no data in the table except the options field. E.g.

Table1
Record    Name      Address        Options
1                                  1234
2                                  123
3                                  58

So give this data, you want to show name, address and options, but only if the name and address fields are not empty.

Is that correct ? If not, I need you to give me examples of what you mean.
0
 
LVL 1

Expert Comment

by:Marcius
ID: 1351242
Regarding the above comment, please note that the numbers are supposed to be under the options column, not the address.
0
 
LVL 1

Accepted Solution

by:
Marcius earned 50 total points
ID: 1351243
I have tried out my assumption, and I cannot see a way to stop the TTable from showing the empty fields without using a filter of a TQuery.

My suggestion is that you use a TQuery, since TTable is not very efficient at filtering data. Some like this would work:

Select Name, Address from MyTable
Where Name <> '' and Address <> ''

This will return only those rows which contain meaningful data.
0
 

Author Comment

by:koger
ID: 1351244
Thanx, it will do I filter all the rows where there is written
hidden column <> ''
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now