faustf Posted April 12, 2013 Share Posted April 12, 2013 hi guy i have a a program simple. Func _inserimento_anagrafica() ;_SQLite_Exec($Db, "Insert into anagrafica values ("&$ditta_op&","&$via_op&","&$citta_op&","&$prov_op&","&$mail_op&","&$cell_op&","&$piva_op&","&$cdifi_op&","&$tell_op&","&$fax_op&","&$cap_op&","&$ditta_leg&","&$via_leg&","&$prov_leg&","&$mail_leg&","&$piva_leg&","&$cdifis_leg&","&$tell_leg&","&$fax_leg&","&$cap_leg&","&$iban_leg&","&$swift_leg&","&$banca_leg&");" ) ;_SQLite_Exec($Db, "Insert into $Db=_SQLite_Open($percorso_Db); Open a permanent disk database If @error Then MsgBox(16+262144, "SQLite Error", "Can't create a memory Database!") Exit -1 EndIf _SQLite_Exec($Db, "Insert into anagrafica values (Ana_Nome ,"&$ditta_op&" );") _SQLite_Close() _SQLite_Shutdown() EndFunc 1 a gui by the gui insert data in sqlite but when try to insert have this error >Running:(3.3.8.1):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\stefano\Documents\programmazione\SANDRO GEST\sandro-gest.au3" ! SQLite.au3 Error --> Function: _SQLite_Exec --> Query: Insert into anagrafica values (Ana_Nome ,de ); --> Error: no such column: Ana_Nome +>15:20:21 AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 16.264 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted April 12, 2013 Moderators Share Posted April 12, 2013 Where are you instantiating "Ana_Nome", is it spelled correctly? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
faustf Posted April 12, 2013 Author Share Posted April 12, 2013 yea the structure of sql is CREATE TABLE [anagrafica] ( [ana_id] integer NOT NULL PRIMARY KEY AUTOINCREMENT, [Ana_Nome] varchar(25), [Ana_Indirizzo] varchar(25), [Ana_Citta] varchar(25), [Ana_Provincia] varchar(25), [Ana_Piva] varchar(25), [Ana_CdF] varchar(25), [Ana_telefono] varchar(25), [Ana_mail] varchar(25), [Ana_cell] varchar(25), [Ana_fax] varchar(25), [Ana_Nazione] varchar(25), [Ana_Nome_Legale] varchar(25), [Ana_Indirizzo_Legale] varchar(25), [Ana_Citta_Legale] varchar(25), [Ana_Provincia_Legale] varchar(25), [Ana_Nazione_Legale] varchar(25), [Ana_Ricordare] varchar(25), [Ana_Mail_legale] varchar(25), [Ana_Bank] varchar(25), [Ana_Iban] varchar(25), [Ana_Swift] varchar(25), [Ana_Cell_Legale] varchar(25), [Ana_Cap] varchar(25), [Ana_Cap_Legale] varchar(25), [Ana_Legale_e_Fisico] varchar(25), [Ana_pagamento_assegnato] varchar(25) ) GO Link to comment Share on other sites More sharing options...
faustf Posted April 12, 2013 Author Share Posted April 12, 2013 i understund some i try to modify the program in this mode Func _inserimento_anagrafica() ;_SQLite_Exec($Db, "Insert into anagrafica values ("&$ditta_op&","&$via_op&","&$citta_op&","&$prov_op&","&$mail_op&","&$cell_op&","&$piva_op&","&$cdifi_op&","&$tell_op&","&$fax_op&","&$cap_op&","&$ditta_leg&","&$via_leg&","&$prov_leg&","&$mail_leg&","&$piva_leg&","&$cdifis_leg&","&$tell_leg&","&$fax_leg&","&$cap_leg&","&$iban_leg&","&$swift_leg&","&$banca_leg&");" ) ;_SQLite_Exec($Db, "Insert into $Db=_SQLite_Open($percorso_Db); Open a permanent disk database If @error Then MsgBox(16+262144, "SQLite Error", "Can't create a memory Database!") Exit -1 EndIf _SQLite_Exec($Db, "Insert into anagrafica values (0,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8 );") ;_SQLite_Exec($Db, "Insert into anagrafica values ("&$ditta_op&","&$via_op&","&$citta_op&","&$prov_op&","&$mail_op&","&$cell_op&","&$piva_op&","&$cdifi_op&","&$tell_op&","&$fax_op&","&$cap_op&","&$ditta_leg&","&$via_leg&","&$prov_leg&","&$mail_leg&","&$piva_leg&","&$cdifis_leg&","&$tell_leg&","&$fax_leg&","&$cap_leg&","&$iban_leg&","&$swift_leg&","&$banca_leg&");" ) _SQLite_Close() _SQLite_Shutdown() EndFunc in this mode one insert do but is possible for sqlite autoincrement (in this case ana_id ?) because if i try insert second time have this error SQLite.au3 Error --> Function: _SQLite_Exec --> Query: Insert into anagrafica values (0,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8 ); --> Error: PRIMARY KEY must be unique Link to comment Share on other sites More sharing options...
faustf Posted April 12, 2013 Author Share Posted April 12, 2013 i answer me: i must use a NULL , 1,2,3, ..... IN THIS MODE SQLITE UNDERSTUND MUST USE AUTOINCREMENT Link to comment Share on other sites More sharing options...
faustf Posted April 12, 2013 Author Share Posted April 12, 2013 but now with this sostitution expandcollapse popupFunc _inserimento_anagrafica() ;_SQLite_Exec($Db, "Insert into anagrafica values ("&$ditta_op&","&$via_op&","&$citta_op&","&$prov_op&","&$mail_op&","&$cell_op&","&$piva_op&","&$cdifi_op&","&$tell_op&","&$fax_op&","&$cap_op&","&$ditta_leg&","&$via_leg&","&$prov_leg&","&$mail_leg&","&$piva_leg&","&$cdifis_leg&","&$tell_leg&","&$fax_leg&","&$cap_leg&","&$iban_leg&","&$swift_leg&","&$banca_leg&");" ) ;_SQLite_Exec($Db, "Insert into $Db=_SQLite_Open($percorso_Db); Open a permanent disk database If @error Then MsgBox(16+262144, "SQLite Error", "Can't create a memory Database!") Exit -1 EndIf ;_SQLite_Exec($Db, "Insert into anagrafica values (NULL,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8 );") _SQLite_Exec($Db, "Insert into anagrafica values (NULL," & _ $ditta_op & _ ","& $via_op & _ ","& $citta_op & _ ","& $prov_op & _ ","& $mail_op & _ ","& $cell_op & _ ","& $piva_op & _ ","& $cdifi_op & _ ","& $tell_op & _ ","& $fax_op & _ ","& $cap_op & _ ","& $ditta_leg & _ ","& $via_leg& _ ","& $citta_leg & _ ","& $prov_leg & _ ","& $mail_leg & _ ","& $cell_leg & _ ","& $piva_leg & _ ","& $cdifis_leg & _ ","& $tell_leg & _ ","& $fax_leg & _ ","& $cap_leg & _ ","& $iban_leg & _ ","& $swift_leg & _ ","& $banca_leg&");") _SQLite_Close() _SQLite_Shutdown() EndFunc dont go ((( ! SQLite.au3 Error --> Function: _SQLite_Exec --> Query: Insert into anagrafica values (NULL,deede,,,,,,,,,,,,,,,,,,,,,,,,); --> Error: near ",": syntax error Link to comment Share on other sites More sharing options...
jdelaney Posted April 12, 2013 Share Posted April 12, 2013 (edited) If it auto increments, don't declare it in the insert at all...skip that column...you can't add null on the key column...edit: your syntax is correct, but, this is also, and allows you to skip the NULL'sInert into your_table_name (column3name, column4name, etcname) values (column3value, column4value, etcvalue)http://www.w3schools.com/sql/sql_insert.aspINSERT INTO table_name (column1, column2, column3,...)VALUES (value1, value2, value3,...) Edited April 12, 2013 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
faustf Posted April 15, 2013 Author Share Posted April 15, 2013 i correct the script in this mode expandcollapse popupFunc _inserimento_anagrafica() ;_SQLite_Exec($Db, "Insert into anagrafica values ("&$ditta_op&","&$via_op&","&$citta_op&","&$prov_op&","&$mail_op&","&$cell_op&","&$piva_op&","&$cdifi_op&","&$tell_op&","&$fax_op&","&$cap_op&","&$ditta_leg&","&$via_leg&","&$prov_leg&","&$mail_leg&","&$piva_leg&","&$cdifis_leg&","&$tell_leg&","&$fax_leg&","&$cap_leg&","&$iban_leg&","&$swift_leg&","&$banca_leg&");" ) ;_SQLite_Exec($Db, "Insert into $Db=_SQLite_Open($percorso_Db); Open a permanent disk database If @error Then MsgBox(16+262144, "SQLite Error", "Can't create a memory Database!") Exit -1 EndIf ;_SQLite_Exec($Db, "Insert into anagrafica values (NULL,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6,7,8 );") _SQLite_Exec($Db, "Insert into anagrafica (ana_id,ana_nome,ana_indirizzo,ana_citta,ana_provincia,ana_piva,ana_cdf,ana_telefono,ana_mail,ana_cell,ana_fax,ana_nazione,ana_nome_legale,ana_indirizzo_legale,ana_citta_legale,ana_provincia_legale,ana_nazione_legale,ana_ricordare,ana_mail_legale,ana_bank,ana_iban,ana_swift,ana_cell_legale,ana_cap,ana_cap_legale,ana_legale_e_fisico,ana_pagamento_assegnato)values (NULL," & _ $ditta_op & _ ","& $via_op & _ ","& $citta_op & _ ","& $prov_op & _ ","& $mail_op & _ ","& $cell_op & _ ","& $piva_op & _ ","& $cdifi_op & _ ","& $tell_op & _ ","& $fax_op & _ ","& $cap_op & _ ","& $ditta_leg & _ ","& $via_leg& _ ","& $citta_leg & _ ","& $prov_leg & _ ","& $mail_leg & _ ","& $cell_leg & _ ","& $piva_leg & _ ","& $cdifis_leg & _ ","& $tell_leg & _ ","& $fax_leg & _ ","& $cap_leg & _ ","& $iban_leg & _ ","& $swift_leg & _ ","& $banca_leg&");") _SQLite_Close() _SQLite_Shutdown() EndFunc but have a error ! SQLite.au3 Error --> Function: _SQLite_Exec --> Query: Insert into anagrafica (ana_id,ana_nome,ana_indirizzo,ana_citta,ana_provincia,ana_piva,ana_cdf,ana_telefono,ana_mail,ana_cell,ana_fax,ana_nazione,ana_nome_legale,ana_indirizzo_legale,ana_citta_legale,ana_provincia_legale,ana_nazione_legale,ana_ricordare,ana_mail_legale,ana_bank,ana_iban,ana_swift,ana_cell_legale,ana_cap,ana_cap_legale,ana_legale_e_fisico,ana_pagamento_assegnato)values (NULL,de,,,,,,,,,,,,,,,,,,,,,,,,); --> Error: near ",": syntax error Link to comment Share on other sites More sharing options...
jchd Posted April 15, 2013 Share Posted April 15, 2013 Litteral strings in SQL statements need to be enclosed in single quotes, 'like this'. Also to prevent errors, you must use _SQLite_FastEscape to escape (= double) significant single quotes inside the string itself. 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) Link to comment Share on other sites More sharing options...
faustf Posted April 15, 2013 Author Share Posted April 15, 2013 how you can send me example?? Link to comment Share on other sites More sharing options...
Nessie Posted April 15, 2013 Share Posted April 15, 2013 Here you can see all that you need:http://www.autoitscript.com/autoit3/docs/libfunctions/_SQLite_FastEscape.htmCiao! My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s). My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all! My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file Link to comment Share on other sites More sharing options...
faustf Posted April 15, 2013 Author Share Posted April 15, 2013 sorry but not understund this example Link to comment Share on other sites More sharing options...
faustf Posted April 15, 2013 Author Share Posted April 15, 2013 i correct script and quote like this expandcollapse popup_SQLite_Exec($Db, 'Insert into anagrafica (ana_id' & _ ',ana_nome' & _ ',ana_indirizzo' & _ ',ana_citta' & _ ',ana_provincia' & _ ',ana_piva' & _ ',ana_cdf' & _ ',ana_telefono' & _ ',ana_mail' & _ ',ana_cell' & _ ',ana_fax' & _ ',ana_nazione' & _ ',ana_nome_legale' & _ ',ana_indirizzo_legale' & _ ',ana_citta_legale' & _ ',ana_provincia_legale' & _ ',ana_nazione_legale' & _ ',ana_ricordare' & _ ',ana_mail_legale' & _ ',ana_bank' & _ ',ana_iban' & _ ',ana_swift' & _ ',ana_cell_legale' & _ ',ana_cap' & _ ',ana_cap_legale' & _ ',ana_legale_e_fisico' & _ ',ana_pagamento_assegnato)values (NULL,' & _ $ditta_op & _ ','& $via_op & _ ','& $citta_op & _ ','& $prov_op & _ ','& $mail_op & _ ','& $cell_op & _ ','& $piva_op & _ ','& $cdifi_op & _ ','& $tell_op & _ ','& $fax_op & _ ','& $cap_op & _ ','& $ditta_leg & _ ','& $via_leg& _ ','& $citta_leg & _ ','& $prov_leg & _ ','& $mail_leg & _ ','& $cell_leg & _ ','& $piva_leg & _ ','& $cdifis_leg & _ ','& $tell_leg & _ ','& $fax_leg & _ ','& $cap_leg & _ ','& $iban_leg & _ ','& $swift_leg & _ ','& $banca_leg & _ ', pagamento assegnato);') but have the same problem ! SQLite.au3 Error --> Function: _SQLite_Exec --> Query: Insert into anagrafica (ana_id,ana_nome,ana_indirizzo,ana_citta,ana_provincia,ana_piva,ana_cdf,ana_telefono,ana_mail,ana_cell,ana_fax,ana_nazione,ana_nome_legale,ana_indirizzo_legale,ana_citta_legale,ana_provincia_legale,ana_nazione_legale,ana_ricordare,ana_mail_legale,ana_bank,ana_iban,ana_swift,ana_cell_legale,ana_cap,ana_cap_legale,ana_legale_e_fisico,ana_pagamento_assegnato)values (NULL,de,,,,,,,,,,,de,,,,,,,,,,,,,, pagamento assegnato); --> Error: near ",": syntax error Link to comment Share on other sites More sharing options...
jchd Posted April 15, 2013 Share Posted April 15, 2013 (edited) Please try to do some (at least some) of your homework by yourself! In SQL (and SQLite is no exception) schema names (names of databases, tables, views, columns, etc.) may need to be enclosed in double quotes "mytable" if the name is a reserved keyword or contains whitespaces or unusual characters "my personal table". Litteral strings (string values) always need to be enclosed in single quotes: insert into "my favorite table" (id, "full name", address, "phone number") values (123456, 'Microsoft inc.', '1 Microsoft avenue', '115'); Now realize that if a string contains itself a significant single quote you need to escape it by doubling it, like in 'O''Connor'. You can have that done by _SQLite_Fastescape(). So your code should look like: _SQLite_Exec($Db, "Insert into anagrafica (ana_id, ana_nome, ana_indirizzo, ... ana_legale_e_fisico, ana_pagamento_assegnato) " & _ "values (NULL, " & _ _SQLite_FastEscape($ditta_op) & "," & _ _SQLite_Fastescape($via_op) & "," & _ ... _SQLite_Fastescape($banca_leg) & "," & _ _SQLite_Fastescape($pagamento_assegnato & ");" ) ; there was a missing $ and probably also _ on this variable I have no idea which variable is numeric and which is a string so I blindly used _SQLite_Fastescape(). You should sort that point out by yourself. Also check that the values of your variables are correct before inserting. Edited April 15, 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) Link to comment Share on other sites More sharing options...
faustf Posted April 15, 2013 Author Share Posted April 15, 2013 but in this mode have syntax erorr Link to comment Share on other sites More sharing options...
jchd Posted April 15, 2013 Share Posted April 15, 2013 Please double check my post as I had to edit it several times. 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) Link to comment Share on other sites More sharing options...
faustf Posted April 15, 2013 Author Share Posted April 15, 2013 the last pagamento_assegnato is not variable is only text Link to comment Share on other sites More sharing options...
faustf Posted April 15, 2013 Author Share Posted April 15, 2013 i do in this mode i hope is correct _SQLite_Exec($Db, "Insert into anagrafica (ana_id,ana_nome,ana_indirizzo,ana_citta,ana_provincia,ana_piva,ana_cdf,ana_telefono,ana_mail,ana_cell,ana_fax,ana_nazione,ana_nome_legale,ana_indirizzo_legale,ana_citta_legale,ana_provincia_legale,ana_nazione_legale,ana_ricordare,ana_mail_legale,ana_bank,ana_iban,ana_swift,ana_cell_legale,ana_cap,ana_cap_legale,ana_legale_e_fisico,ana_pagamento_assegnato)" & _ "values (NULL," & _ _SQLite_FastEscape($ditta_op)& "," & _ _SQLite_FastEscape($via_op)& "," & _ _SQLite_FastEscape($citta_op)& "," & _ _SQLite_FastEscape($prov_op)& "," & _ _SQLite_FastEscape($mail_op)& "," & _ _SQLite_FastEscape($cell_op)& "," & _ _SQLite_FastEscape($piva_op)& "," & _ _SQLite_FastEscape($cdifi_op)& "," & _ _SQLite_FastEscape($tell_op)& "," & _ _SQLite_FastEscape($fax_op)& "," & _ _SQLite_FastEscape($cap_op)& "," & _ _SQLite_FastEscape($ditta_leg)& "," & _ _SQLite_FastEscape($via_leg)& "," & _ _SQLite_FastEscape($citta_leg)& "," & _ _SQLite_FastEscape($prov_leg)& "," & _ _SQLite_FastEscape($mail_leg)& "," & _ _SQLite_FastEscape($cell_leg)& "," & _ _SQLite_FastEscape($piva_leg)& "," & _ _SQLite_FastEscape($cdifis_leg)& "," & _ _SQLite_FastEscape($tell_leg)& "," & _ _SQLite_FastEscape($fax_leg)& "," & _ _SQLite_FastEscape($cap_leg)& "," & _ _SQLite_FastEscape($iban_leg)& "," & _ _SQLite_FastEscape($swift_leg)& "," & _ _SQLite_FastEscape($banca_leg )& _ ", pagamento assegnato);") have this error ! SQLite.au3 Error --> Function: _SQLite_Exec --> Query: Insert into anagrafica (ana_id,ana_nome,ana_indirizzo,ana_citta,ana_provincia,ana_piva,ana_cdf,ana_telefono,ana_mail,ana_cell,ana_fax,ana_nazione,ana_nome_legale,ana_indirizzo_legale,ana_citta_legale,ana_provincia_legale,ana_nazione_legale,ana_ricordare,ana_mail_legale,ana_bank,ana_iban,ana_swift,ana_cell_legale,ana_cap,ana_cap_legale,ana_legale_e_fisico,ana_pagamento_assegnato)values (NULL,'de','','','','','','','','','','','','','','','','','','','','','','','','', pagamento assegnato); --> Error: near "assegnato": syntax error Link to comment Share on other sites More sharing options...
faustf Posted April 15, 2013 Author Share Posted April 15, 2013 i do mistake in end of and i do this code but now give syntax error _SQLite_Exec($Db, "Insert into anagrafica (ana_id,ana_nome,ana_indirizzo,ana_citta,ana_provincia,ana_piva,ana_cdf,ana_telefono,ana_mail,ana_cell,ana_fax,ana_nazione,ana_nome_legale,ana_indirizzo_legale,ana_citta_legale,ana_provincia_legale,ana_nazione_legale,ana_ricordare,ana_mail_legale,ana_bank,ana_iban,ana_swift,ana_cell_legale,ana_cap,ana_cap_legale,ana_legale_e_fisico,ana_pagamento_assegnato)" & _ "values (NULL," & _ _SQLite_FastEscape($ditta_op)& "," & _ _SQLite_FastEscape($via_op)& "," & _ _SQLite_FastEscape($citta_op)& "," & _ _SQLite_FastEscape($prov_op)& "," & _ _SQLite_FastEscape($mail_op)& "," & _ _SQLite_FastEscape($cell_op)& "," & _ _SQLite_FastEscape($piva_op)& "," & _ _SQLite_FastEscape($cdifi_op)& "," & _ _SQLite_FastEscape($tell_op)& "," & _ _SQLite_FastEscape($fax_op)& "," & _ _SQLite_FastEscape($cap_op)& "," & _ _SQLite_FastEscape($ditta_leg)& "," & _ _SQLite_FastEscape($via_leg)& "," & _ _SQLite_FastEscape($citta_leg)& "," & _ _SQLite_FastEscape($prov_leg)& "," & _ _SQLite_FastEscape($mail_leg)& "," & _ _SQLite_FastEscape($cell_leg)& "," & _ _SQLite_FastEscape($piva_leg)& "," & _ _SQLite_FastEscape($cdifis_leg)& "," & _ _SQLite_FastEscape($tell_leg)& "," & _ _SQLite_FastEscape($fax_leg)& "," & _ _SQLite_FastEscape($cap_leg)& "," & _ _SQLite_FastEscape($iban_leg)& "," & _ _SQLite_FastEscape($swift_leg)& "," & _ _SQLite_FastEscape($banca_leg )& "," & _ _SQLite_FastEscape($banca_leg& ");" ) _SQLite_Close() _SQLite_Shutdown() code error C:\Users\stefano\Documents\programmazione\SANDRO GEST\sandro-gest.au3(390,43) : ERROR: syntax error _SQLite_FastEscape($banca_leg)&"; )" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\stefano\Documents\programmazione\SANDRO GEST\sandro-gest.au3 - 1 error(s), 0 warning(s) !>18:52:20 AU3Check ended.rc:2 >Exit code: 0 Time: 2.754 Link to comment Share on other sites More sharing options...
jchd Posted April 15, 2013 Share Posted April 15, 2013 Once again, a text litteral (constant or from a variable) NEEDS to be enclosed in single quotes. Also since ana_id is an autoincrement primary key, simply don't list it in the list of inserted columns: _SQLite_Exec($Db, "Insert into anagrafica (ana_nome,ana_indirizzo,ana_citta,ana_provincia,ana_piva,ana_cdf,ana_telefono,ana_mail,ana_cell,ana_fax,ana_nazione,ana_nome_legale,ana_indirizzo_legale,ana_citta_legale,ana_provincia_legale,ana_nazione_legale,ana_ricordare,ana_mail_legale,ana_bank,ana_iban,ana_swift,ana_cell_legale,ana_cap,ana_cap_legale,ana_legale_e_fisico,ana_pagamento_assegnato)" & _ "values (" & _SQLite_FastEscape($ditta_op)& "," & _ _SQLite_FastEscape($via_op)& "," & _ _SQLite_FastEscape($citta_op)& "," & _ _SQLite_FastEscape($prov_op)& "," & _ _SQLite_FastEscape($mail_op)& "," & _ _SQLite_FastEscape($cell_op)& "," & _ _SQLite_FastEscape($piva_op)& "," & _ _SQLite_FastEscape($cdifi_op)& "," & _ _SQLite_FastEscape($tell_op)& "," & _ _SQLite_FastEscape($fax_op)& "," & _ _SQLite_FastEscape($cap_op)& "," & _ _SQLite_FastEscape($ditta_leg)& "," & _ _SQLite_FastEscape($via_leg)& "," & _ _SQLite_FastEscape($citta_leg)& "," & _ _SQLite_FastEscape($prov_leg)& "," & _ _SQLite_FastEscape($mail_leg)& "," & _ _SQLite_FastEscape($cell_leg)& "," & _ _SQLite_FastEscape($piva_leg)& "," & _ _SQLite_FastEscape($cdifis_leg)& "," & _ _SQLite_FastEscape($tell_leg)& "," & _ _SQLite_FastEscape($fax_leg)& "," & _ _SQLite_FastEscape($cap_leg)& "," & _ _SQLite_FastEscape($iban_leg)& "," & _ _SQLite_FastEscape($swift_leg)& "," & _ _SQLite_FastEscape($banca_leg )&"," & _ "'pagamento assegnato');") 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) Link to comment Share on other sites More sharing options...
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