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.


SQLite Update Problem


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-09-2007, 10:31 PM
Junior Member
 
Join Date: May 2007
Location: Norwich, NY
Posts: 13
Send a message via Skype™ to david
Default SQLite Update Problem

Hi Erel,

I am having difficulty getting any sql updates to work.

Please see the following code:


Sub btnInsert_Click
' Temporary Code To Check Database Inserts or Updates (Depending On What has been commented out). This is only test code!

' Command.CommandText = "Insert Into LogNumber(Lognum, Descrip) Values('" & txtLogNum.Text &"', '" & txtLocation.Text & "')"

' Command.CommandText = "Insert Into LogNumber(Lognum, Descrip) Values( 'Test Number', 'Test Description' )"

Command.CommandText "Update LogNumber Set Descrip = 'New Description'"

Command.ExecuteNonQuery
End Sub

The lines that have been commented out work fine when they are compiled in.

That is I can insert records through variables or actual strings.

I cannot update successfully whether or not I use variables or strings or a "Where" condition.

It does work at the prompt with sqlite3 in a windows command window, so it is not a database issue?

Am I doing something wrong?

Also can you point me to code that tells me how to capture sql database exceptions and provide the appropriate error messages.

Thank you very much.

Regards,

David
Reply With Quote
  #2 (permalink)  
Old 10-10-2007, 11:22 AM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,956
Default

I've checked this code (on the desktop and the device) and it works properly:
Code:
        Cmd.CommandText = "UPDATE table1 SET col2 = 'new value' WHERE col1 = '136'" 
        Cmd.ExecuteNonQuery
You could catch all errors with ErrorLabel.
What kind of errors do you want to catch?
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
Regarding SQLite problem mozaharul Questions & Help Needed 0 04-02-2008 09:28 AM
Help on Sqlite Update Command jeterry Questions & Help Needed 13 03-31-2008 08:45 AM
Problem Converting CSV to SQLite tcgoh Questions & Help Needed 5 11-01-2007 02:50 AM
Another sqlite problem! giannimaione Questions & Help Needed 5 05-13-2007 07:25 AM
Problem mit SQLite und CheckBox Fontanus German Forum 6 05-06-2007 03:03 PM


All times are GMT. The time now is 07:44 AM.


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