Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Databases
»
Update doesn't work and break sqlite connexion...
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Poll: Watches and Display...
by
440bx
[
Today
at 08:35:46 pm]
Controlling the behavior ...
by
wp
[
Today
at 08:29:28 pm]
Offical launch of the 1 B...
by
Gustavo 'Gus' Carreno
[
Today
at 08:21:29 pm]
Dialog ShowModal and an i...
by
ASerge
[
Today
at 08:04:11 pm]
JEDI error but unit compi...
by
bytebites
[
Today
at 07:49:17 pm]
how to change the color f...
by
wp
[
Today
at 07:23:58 pm]
how to search in rxmemory...
by
korba812
[
Today
at 06:57:30 pm]
Dynarray initialization p...
by
Thaddy
[
Today
at 06:30:12 pm]
Project fails on run but ...
by
dseligo
[
Today
at 05:30:42 pm]
Zeos components. Had to c...
by
Fantablup
[
Today
at 04:17:13 pm]
[SOLVED] Completion box s...
by
furious programming
[
Today
at 04:12:26 pm]
[LAMW] How to create a ca...
by
af0815
[
Today
at 03:48:16 pm]
Complex package installat...
by
wp
[
Today
at 03:38:16 pm]
A "leisure" question on W...
by
gidesa
[
Today
at 03:17:10 pm]
Curling Pythagoras Tree: ...
by
AlexTP
[
Today
at 03:07:53 pm]
[SOLVED] Combined pointer...
by
CM630
[
Today
at 02:48:41 pm]
Using KeyPress event, how...
by
Zvoni
[
Today
at 02:24:42 pm]
a Unit problem?
by
Thaddy
[
Today
at 01:56:12 pm]
Understanding and adjusti...
by
ArchChem
[
Today
at 12:58:12 pm]
Any upgrades to fpWeb pag...
by
marcov
[
Today
at 12:50:25 pm]
Help needed with Cairo / ...
by
Roland57
[
Today
at 12:25:16 pm]
Configure JCF messages
by
DomingoGP
[
Today
at 11:26:55 am]
IDE instability on Raspbe...
by
rvk
[
Today
at 10:37:14 am]
Boleeman's projects are p...
by
AlexTP
[
Today
at 10:18:04 am]
Your best UI design - con...
by
circular
[
Today
at 09:36:11 am]
« previous
next »
Print
Pages:
1
[
2
]
Author
Topic: Update doesn't work and break sqlite connexion... (Read 9956 times)
nadop
New Member
Posts: 12
Re: Update doesn't work and break sqlite connexion...
«
Reply #15 on:
March 31, 2016, 03:06:02 pm »
Also you can set properties
In SQLQuery
Options.sqoAutoApplyUpdate in True
In SQLTransaction
Action in caCommit
And set property you DataSource
AutoEdit in True
And comment EnregistrerLesChangements in Quitter.
Logged
gelinp
Full Member
Posts: 114
Re: Update doesn't work and break sqlite connexion...
«
Reply #16 on:
April 02, 2016, 07:01:43 am »
I reply to myself, I succedeed to correct my code and data parameters.
I attached screen casts of data parameters for components Connexion, Transaction, SQLs and DataSource. And also source code and .lfm of main form.
What was wrong ? Some parameters like :
TSQLQuery
:
sqoAutoApplyUpdates and sqoAutoCommit
(not activated was wrong). Also
AutoCalcFields
(not activated was wrong).
UpdateMethode = upWhereKeyOnly
TDataSource
:
AutoEdit
(not activated was wrong)
Transaction
:
Action
could be caNone because I read in wiki that it is not used... But I need to activate
Option stoUseImplicit
.
In main source code I added a procedure to connect dynamically. Finally I Idded log events, it display UPDATE SQLquery and it's fine. Look for main.pas file into zip file to read all code...
:
Code: Pascal
[Select]
[+]
[-]
procedure
TFormMain
.
DynamicConnect
;
var
dir
:
shortstring
;
begin
// Retrouve le dossier courrant (0 indique le dossier courant)
getdir
(
0
,
dir
)
;
// bibliothèque Sqlite...
{$IFDEF Windows}
SQLiteDefaultLibrary
:
=
dir
+
'\sqlite3.dll'
;
{$ELSE}
SQLiteDefaultLibrary
:
=
'/usr/lib/libsqlite3.so'
;
{$ENDIF}
// Connect
SQLMasterSequences
.
Close
;
SQLDetailSeances
.
Close
;
if
not
SQLite3Connection1
.
Connected
then
begin
{$IFDEF Windows}
SQLite3Connection1
.
DatabaseName
:
=
dir
+
'\data.sqlite'
;
{$ELSE}
SQLite3Connection1
.
DatabaseName
:
=
dir
+
'/data.sqlite'
;
{$ENDIF}
end
;
SQLite3Connection1
.
Connected
:
=
true
;
SQLTransaction1
.
Active
:
=
true
;
SQLMasterSequences
.
Open
;
SQLDetailSeances
.
Open
;
// We do need to tell our TSQLConnection what to log:
SQLite3Connection1
.
LogEvents
:
=
LogAllEvents
;
//= [detCustom, detPrepare, detExecute, detFetch, detCommit, detRollBack]
// ... and to which procedure the connection should send the events:
SQLite3Connection1
.
OnLog
:
=
@
Self
.
GetLogEvent
;
end
;
Thank you very much for your help ! Thank you again to helped me :-)
«
Last Edit: April 02, 2016, 07:15:48 am by gelinp
»
Logged
My configuration is : Lazarus 1.6+dfsg-1 / FPC 3.0.0 / Debian Mint / x86_64-linux-gtk2
Print
Pages:
1
[
2
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Databases
»
Update doesn't work and break sqlite connexion...
TinyPortal
© 2005-2018