forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Internal data handling! I can't find a solution... :(

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Raymond175
Contributor
Contributor


Joined: 24 Apr 2002
Posts: 72

PostPosted: Sun Jan 22, 2006 8:53 pm    Post subject: Internal data handling! I can't find a solution... :( Reply with quote

Hello,

I'm building an administrationsystem which consists of couple of data-elements, containing data like: client information (table), todo (list), agenda (list), invoices (table), etc...

The data is retrieved from an database file (mdb), and work perfectly. The only problem is that for example my agenda cannot store information about the key (ID) in the database. I know that this sounds a bit difficult, but I'll try to explain:

In the database: AGENDA
[ID]1[DATE]22-01-2006[TIME]13:00-15:00[DESCRIPTION]Install computer at friends house...

In the list (=only 1 element on a row) on my application:
"Install computer at friends house..."

Now when I for example double click on the "Install computer at friends house" the application must be able to load all data regarding this record from the database. The best way to do this is to retrieve the ID which I can directly use for quering the database. I only want to query the database by ID, not by DESCRIPTIONs or anything...

How can I efficiently store all the ID's of all the records in the lists and tables my application uses. The records in those lists can change frequently. For example the agenda list changes when another date is selected. Other data is then loaded into the list...

I've been thinking about a solution for this for 2 days right now, and I've tried several things, but I can't find a good solution. Now I'll try my luck with you guys...

I hope you can help...

Thanks,
Raymond
Back to top
View user's profile Send private message
JRoza
Contributor
Contributor


Joined: 17 Aug 2003
Posts: 182
Location: Netherlands

PostPosted: Sun Jan 22, 2006 10:13 pm    Post subject: Reply with quote

Whenever I have a list with just one column in it and the real data has many more columns I use two lists for the data: one for display purposes with just the one column that you want to display and one list with all data from the corresponding record.
Now when you click for example on the third line in the displaylist you can find the corresponding ID in the other internal list in the third line.
The only thing you need to do in your program at startup is fill list1 (display) and list2 from the mdb file and whenever you delete a line from list1 you need to delete this from list2 (and the mdb) as well.

Hope this helps.

Very Happy
Jan
Back to top
View user's profile Send private message Visit poster's website
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Mon Jan 23, 2006 2:03 am    Post subject: Reply with quote

I'm trying to figure out why you don't want to query the db against what the user sees in the list.

Are the decriptions not unique?

If not, are the descriptions unique to each date?

eg. "Select * From <database> where <database>.[Date] ='<SelectedDate>' AND <database>.[Description] = <SelectedDescr>;"

I'm just wondering why you are using a database if you're going to load ALL the data at program start up. Depending on how large the DB is your app could potenially use up a lot of memory.

You could collect the the [ID] and [Descr] and place them in a table element instead of a List element and just hide the [ID] column (Set its width to "0"). I believe you can even hide the Table header with API if you want. This way the user only sees the Description. When they CLICK or DBLCLICK the row you can parse out the [ID] and query against it.
If you must load all the data, you can put all the data in the same Table element and just hide the columns you don't need the user to see.

Just thought I'd through in my 2 cents Wink
Back to top
View user's profile Send private message Send e-mail
Raymond175
Contributor
Contributor


Joined: 24 Apr 2002
Posts: 72

PostPosted: Mon Jan 23, 2006 7:09 am    Post subject: Reply with quote

JRoza, I know that a mirrored list for internal handling is one of the easiest ways to achieve this, but then I need for all lists an internal list as well, which is a little inconvinient.

Aslan, I've thought about that one too and it might work if I can hide the header (which must work under Win95-WinXP) or when I can lock the widths of the columns, so I can set the width to 0. Do you know if this is possible? I do not want the user to be able to drag the 'invisible' header so it will be visible...

The reason I do not want to query with the original data is because this can be very long, has strange characters that mess up the query, is not unique, even with date and time in it...

Thanks,
Raymond
Back to top
View user's profile Send private message
marty
Professional Member
Professional Member


Joined: 10 May 2001
Posts: 789

PostPosted: Mon Jan 23, 2006 7:44 pm    Post subject: Reply with quote

Quote:
Aslan, I've thought about that one too and it might work if I can hide the header (which must work under Win95-WinXP) or when I can lock the widths of the columns, so I can set the width to 0. Do you know if this is possible? I do not want the user to be able to drag the 'invisible' header so it will be visible...


BTW I do this trick in my current application.. works fine and its not visible with width to 0.. And I even have my header shown..

I use the hidden column to store data not visible to the end user. That way I dont did a second list.

Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Thu Jan 26, 2006 12:54 am    Post subject: Reply with quote

Sorry, I took so long to get back with you Raymond.

Here's some code you can use to hide the Table Header:

Code:
LOADLIB USER32
  %%TABLE = <insert your table name here>
  %H = @STRDEL(@WINEXISTS(~%%TABLE),1,1)
  IF %H
  %O = @LIB(USER32,GetWindowLongA,INT:,%H,-16)
  %Z = @LIB(USER32,SetWindowLongA,INT:,%H,-16,@SUM(%O,-800000))
  END
  FREELIB USER32


Note: Most of this code was derived from CodeScript's Table API DSU

I can't confirm or deny whether it will work with WIN9X. You will have to test this.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group