faustf Posted April 22, 2013 Posted April 22, 2013 hi guy if i want remove specific record in table is correct if i use this sintax $iocr1 = _GUICtrlListView_GetItemTextArray($List1AC) _SQLite_Query($Db,"DELETE FROM anagrafica WHERE ana_id"&$iocr1[8]&";",$hQuery)
jchd Posted April 22, 2013 Posted April 22, 2013 (edited) A query is ... well, a query. Use a query with "select ... from ... where ...". Also I already advised you to stop using low-level _SQLite_* functions and favor _SQLite_GetTable[2d] instead for querying the DB. But since you need to delete row(s) here, use _SQLite_Exec like this (with an equal sign in the where condition!): _SQLite_Exec($hDB, "delete from anagrafica where ana_id = " & $myvariable) Edited April 22, 2013 by jchd This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
faustf Posted April 22, 2013 Author Posted April 22, 2013 i try to do in this mode but dont go Func _elimina_cliente() $dir_clienti='' $apri_folder='' $iocr1 ='' $iocr1 = _GUICtrlListView_GetItemTextArray($List1AC) _SQL_Startup() $Db=_SQLite_Open($percorso_Db); Open a permanent disk database If @error Then MsgBox(16+262144, "SQLite Error", "Non posso creare il Database!") Exit -1 EndIf _SQLite_Query($Db,"DELETE FROM anagrafica WHERE ana_id = "&$iocr1[8]&";",$hQuery) If @error Then MsgBox(16+262144, "SQLite Error", "Non posso cancellare il record nel database!") ;Exit -1 EndIf _SQLite_Close() _SQLite_Shutdown() EndFunc
kylomas Posted April 22, 2013 Posted April 22, 2013 faustf, Re-read jchd's post... Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill
jchd Posted April 22, 2013 Posted April 22, 2013 Of course you can read and see that the word query is different from the word exec. Just like my previous post strongly hinted to. Of course you can probably devise that $myvariable can be changed to the actual variable you need in your context. What I find surprising is that you consider SQLite so much more difficult than MySQL. At this rate, every SQL engine is going to be hard to you. This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now