Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Newbie-Filling a table but selected fields


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-12-2007, 08:00 PM
Knows the basics
 
Join Date: Oct 2007
Posts: 90
Default Newbie-Filling a table but selected fields

Q1...
I am trying to get going with SQL and a table. I notice the simplicity of filling the table with a single command 'TableExecute'.
However I wish to fill the table but only with 2 of the several fields. Is there a way to do this (and not necessarily in the order the fields appear in the Database Table), fairly simply please?

Q2...
There appear to be no equivalents to 'AbsolutePosition' etc as used in ADO, to enable keeping track when loading say a page at a time from a long database table. Have I missed something?

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 10-12-2007, 09:31 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

A1: You can use any SELECT query with ExecuteTable.
If you want to show 2 fields:
Cmd.CommandText = "SELECT field1, field2 FROM table1"
Cmd.ExecuteTable(...)
A2: You can use the built-in SQLite row index ROWID.
It is always available.
Cmd.CommandText = "SELECT field1, field2 FROM table1 WHERE ROWID > 50 AND ROWID <70"
Cmd.ExecuteTable(...)
Reply With Quote
  #3 (permalink)  
Old 10-12-2007, 10:11 PM
Knows the basics
 
Join Date: Oct 2007
Posts: 90
Default

That is wonderful thank you Erel. I somehow thought that the whole database table would be loaded into the table object. It is obvious now you have explained.
Reply With Quote
  #4 (permalink)  
Old 10-13-2007, 10:40 AM
Knows the basics
 
Join Date: Oct 2007
Posts: 90
Default

Sorry to be a nuisance.
Well it did seem obvious. I have achieved as you suggested.
However I didn't explain well enough. I require the whole table of data to be accessed, but, I only want to 'display' two fields, whilst being able to refer to the others.
A tiny bit more help would be appreciated.
Reply With Quote
  #5 (permalink)  
Old 10-13-2007, 11:10 AM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,689
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

You could load all the data you want to access into a second table that is not visible.
Reply With Quote
  #6 (permalink)  
Old 10-13-2007, 12:09 PM
Knows the basics
 
Join Date: Oct 2007
Posts: 90
Default

Why does every answer make me feel simple?
Great idea, thank you agraham for some lateral thinking.
Reply With Quote
  #7 (permalink)  
Old 10-13-2007, 01:23 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,134
Default

You could also hide the unwanted columns by setting their width to 0.
Reply With Quote
  #8 (permalink)  
Old 10-13-2007, 01:24 PM
Knows the basics
 
Join Date: Oct 2007
Posts: 90
Default

Thank you Erel, for another good suggestion. Spoilt for choice.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Filling an array or structure. enonod Questions & Help Needed 5 05-02-2008 12:56 PM
Settings for User's selected 'theme' willisgt Questions & Help Needed 2 02-21-2008 05:06 PM
Filling 2-D arrays. grgczyz Basic4ppc Wishlist 1 02-14-2008 12:38 PM
Filling arrays Erel Code Samples & Tips 3 01-13-2008 06:11 PM
Tablecell 0 not selected Scubaticus Bug Reports 4 07-30-2007 10:03 PM


All times are GMT. The time now is 06:21 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0