New topic: RESOLVED Delete selected ListBox Item from a database?
<http://forums.realsoftware.com/viewtopic.php?t=47146> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message RicSum Post subject: RESOLVED Delete selected ListBox Item from a database?Posted: Mon Mar 04, 2013 5:20 am Joined: Fri Jun 05, 2009 4:54 pm Posts: 427 Location: London, England Hi, I am almost there but am having a small problem completing the end of line 2 in the code below - could someone please help: dim sql as string sql="DELETE FROM SettingsTable WHERE Sonames=TEXT OF THE THE SELECTED LISTBOX ITEM" db8.sqlexecute (sql) db8.Commit I looked at the language reference "Selected" property, but still have no idea how to format it? Thank you all in advance. _________________ RealStudio Professional Edition 2012 r2 Developing on OS X 10.8 (Mountain Lion) Deploying on Windows XP / 7 / 8 Last edited by RicSum on Mon Mar 04, 2013 7:36 pm, edited 1 time in total. Top kermit Post subject: Re: Delete selected ListBox Item from a database?Posted: Mon Mar 04, 2013 5:52 am Joined: Mon May 30, 2011 12:56 am Posts: 632 dim thetext as string thetext = listbox1.list(listbox1.listindex) thetext = replace(thetext,"'","''") //in case of apostrohes sql="DELETE FROM SettingsTable WHERE Sonames='" + thetext + "'" Top RicSum Post subject: Re: Delete selected ListBox Item from a database?Posted: Mon Mar 04, 2013 5:59 am Joined: Fri Jun 05, 2009 4:54 pm Posts: 427 Location: London, England Thank You So Much ! _________________ RealStudio Professional Edition 2012 r2 Developing on OS X 10.8 (Mountain Lion) Deploying on Windows XP / 7 / 8 Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 posts ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
