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.

Delete a row in a table and simultaneously delete it in the database

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-24-2007, 01:47 PM
Newbie
 
Join Date: Aug 2007
Posts: 4
Default Delete a row in a table and simultaneously delete it in the database

Hello,

I have a table which is filled in by a database and I want to delete data in the database, after I have selected a row in the table.

I give you the code of my SQL request

Con.New1
Cmd.New1("",con.Value)
Con.Open("Data Source = " & AppPath & "\relevegeneraux.sl3")
cmd.CommandText = "DELETE from gaz WHERE ROWID = idrow1"
Cmd.ExecuteNonQuery
Con.Close

I don't know how to make idrow1 appear as a variable in the request.

Thank You
Reply With Quote
  #2 (permalink)  
Old 12-24-2007, 02:01 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

CommandText is just a string, so you should use '&' to insert a variable inside:
Code:
 cmd.CommandText = "DELETE from gaz WHERE ROWID = " & idrow1
Reply With Quote
  #3 (permalink)  
Old 12-25-2007, 02:23 PM
Newbie
 
Join Date: Aug 2007
Posts: 4
Default

Thank you very much
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
Delete from SQLlite ceaser Questions (Windows Mobile) 2 08-24-2008 08:29 AM
Delete keypress emaster Questions (Windows Mobile) 2 12-04-2007 07:15 AM
Delete Control and Delete Form Items alfcen Basic4ppc Wishlist 3 10-05-2007 01:09 PM
Delete a simple row in a database... albert Questions (Windows Mobile) 3 07-01-2007 08:44 PM
Delete rows in table sefi Questions (Windows Mobile) 2 04-30-2007 08:05 PM


All times are GMT. The time now is 05:21 AM.


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