Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

multiple connections to a sqlite database

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-12-2007, 10:14 PM
Peter's Avatar
Junior Member
 
Join Date: May 2007
Location: The Netherlands
Posts: 18
Question multiple connections to a sqlite database

Can anybody please tell me how can i make more than one connection to the same database?

Peter
__________________
PC : P4 3gHz, 2GiB
PPC : LOOX 500 + 1 GiB SD
---------------------------------------------------
(Reminder to self: )
Reply With Quote
  #2 (permalink)  
Old 05-12-2007, 10:17 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Why do You need to make more than one conection to the Same DB in the Same APP?
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #3 (permalink)  
Old 05-12-2007, 10:37 PM
Peter's Avatar
Junior Member
 
Join Date: May 2007
Location: The Netherlands
Posts: 18
Default

The database containes several tables, linked by other tables in the same database.

for example:
table 1 containes films + details, primary key is the filmnumber
table 2 containes filmnumber, personalnumber, functionnumber
table 3 containes data about a person, primary key is personalnumber

Several persons can have the same function with a film.
Connection 1 would be for selecting all personalnumbers with a function in a certain film
connection 2 would be for selecting the data for each person in the results of connection 1.

I had thought this would be the easiest way to get the results i want, instead of storing the results of connection 1 in a temporary variable.

Peter
__________________
PC : P4 3gHz, 2GiB
PPC : LOOX 500 + 1 GiB SD
---------------------------------------------------
(Reminder to self: )
Reply With Quote
  #4 (permalink)  
Old 05-12-2007, 10:47 PM
Cableguy's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: N 41º11'30.30" W 8º39'46.60"
Posts: 2,344
Awards Showcase
Forum Contributer 
Total Awards: 1
Default

Not quite sure if it works but you could try to add several objects with dirent names like "con1","con2",... and then when conecting to the database use the respective con...
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)

My Posts helped you? Consider Buying me a Porto Glass!
Reply With Quote
  #5 (permalink)  
Old 05-13-2007, 05:23 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,733
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Two connections will not help here.
You could do it with one command.
Something like:
SELECT * FROM tabl1, table2, table3 WHERE table1.filmnumber = table2.filmnumber AND table2.personalnumber = table3.personalnumber

Search the web for SQL join for more information.
Reply With Quote
  #6 (permalink)  
Old 05-13-2007, 07:49 AM
Peter's Avatar
Junior Member
 
Join Date: May 2007
Location: The Netherlands
Posts: 18
Default

I know it can be done in one query, in fact it is the easiest (programming)way. The downside of this is a much worse performance.

I haven't tried this with b4ppc (obviously), but i've had some experience with a comparable situation in VB6 on the PC. When i did a single query the results took about 14 seconds, while two queries together took a fraction of a second. Which is why i prefer to do it likewise on the PPC, which requieres two connections.

Peter
__________________
PC : P4 3gHz, 2GiB
PPC : LOOX 500 + 1 GiB SD
---------------------------------------------------
(Reminder to self: )
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 Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating multiple columns in SQLite mozaharul Questions (Windows Mobile) 4 02-21-2010 01:46 PM
Graphic in SQLite Database Picard Questions (Windows Mobile) 1 08-23-2008 11:03 AM
Multiple Serial connections? cwtoyota Questions (Windows Mobile) 1 05-23-2008 11:05 AM
Command to create a database in sqlite mozaharul Questions (Windows Mobile) 5 03-30-2008 03:38 AM
How to convert an Access database to a sqlite database Peter Code Samples & Tips 5 07-24-2007 03:20 PM


All times are GMT. The time now is 06:37 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0