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.

Strange SQLite behaviour

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-23-2009, 08:52 PM
ghale's Avatar
Basic4ppc Veteran
 
Join Date: Dec 2008
Location: Earth, Europe, Italy, Puglia, Lecce
Posts: 219
Unhappy Issue deleting data from SQLite table

Hello eveybody,
I've noticed that if I fill a database table, delete it and fill it again, in the database I find 2 copies of the same data.
If I delete and fill again the same table, I'll find 3 copies of the data and so on.

It's only my issue?

To fill the database I use
-----------
' Start transaction
Connection.BeginTransaction

For i = 0 To alWords.Count-1
strQuery = "INSERT INTO tablename (ID, Item, Item) VALUES (null, '" & alWords.Item(i) & "', 1)"
Command.CommandText = strQuery
Command.ExecuteNonQuery
Next i

' End transaction
Connection.EndTransaction
-----------

To clear the tale I use:
-----------
' Start transaction
Connection.BeginTransaction

Command.CommandText = "DELETE FROM tablename"
Command.ExecuteNonQuery

' End transaction
Connection.EndTransaction
-----------

WHY the items in the table are not deleted?
I'm locked here from 2 hours without a solution!

If I close and reopen the application, all data is deleted!

Someone can help me, please?

Thanks,
bye,
Piero

Last edited by ghale : 07-23-2009 at 09:10 PM.
Reply With Quote
  #2 (permalink)  
Old 07-24-2009, 02:39 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 15,726
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

I've unsuccessfully tried to reproduce this problem.
This code uses the same column name twice:
Code:
strQuery = "INSERT INTO tablename (ID, Item, Item) VALUES (null, '" & alWords.Item(i) & "', 1)"
Can you post a small source which demonstrates this problem?
Reply With Quote
  #3 (permalink)  
Old 07-24-2009, 02:56 PM
ghale's Avatar
Basic4ppc Veteran
 
Join Date: Dec 2008
Location: Earth, Europe, Italy, Puglia, Lecce
Posts: 219
Default

tablename, item and item are dummy names to replace with correct names

I've solved using array, I'll post a sample source with the issue
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
KeyPress event behaviour claudio Questions (Windows Mobile) 1 06-11-2009 07:26 AM
Different behaviour with ImageLibEx and FormLib klaus Beta Versions 5 04-29-2009 08:43 AM
Strange Form behaviour at start HARRY Questions (Windows Mobile) 2 12-31-2008 03:50 PM
Different behaviour DeskTop and Device HARRY Questions (Windows Mobile) 2 02-22-2008 12:36 PM
Strange characters pmu5757 Questions (Windows Mobile) 2 09-30-2007 08:56 AM


All times are GMT. The time now is 04:40 AM.


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