10 messages in org.openoffice.fr.prog[prog] OOo 1.1.5 - Connection - décon...
FromSent OnAttachments
Ludovic CHEVALIERMar 16, 2006 8:37 am 
christian bienassisMar 16, 2006 9:12 am 
Bernard MarcellyMar 16, 2006 12:06 pm 
oo...@volcar.orgMar 16, 2006 11:03 pm 
Laurent GodardMar 17, 2006 12:18 am 
Laurent GodardMar 17, 2006 12:30 am 
chri...@free.frMar 17, 2006 1:13 am 
Ludovic CHEVALIERMar 17, 2006 1:45 am 
Bernard MarcellyMar 17, 2006 1:56 am 
Ludovic CHEVALIERMar 17, 2006 2:20 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[prog] OOo 1.1.5 - Connection - déconnection sourceActions...
From:Ludovic CHEVALIER (tens@no-log.org)
Date:Mar 16, 2006 8:37:41 am
List:org.openoffice.fr.prog

Bonjour,

J'utilise cette fonction pour me connecter à une BDD SQLite sur OOo1.1.5 . Elle est censé ouvrir une transaction, hors, à plusieurs reprise, des plantages m'ont montrés que des insertions avaient eu lieux et que d'autres qui faisaient partie de la même transaction 'apparaissaient pas.

Si vous avez une idée???

Merci,

Ludo

'Se connecte à une source de données Function ConnecterSource(NomSource as String) as Object Dim maSource As Object, monDbContext As Object, demandePasse as Object dim k as object 'Création du contexte monDbContext = CreateUnoService( _ "com.sun.star.sdb.DatabaseContext") maSource=monDbContext.getByName(NomSource)

'Les paramètres de connexion Select Case maSource.IsPasswordRequired Case true demandePasse = CreateUnoService("com.sun.star.sdb.InteractionHandler") ConnecterSource = maSource.connectWithCompletion(demandePasse) Case false ConnecterSource = maSource.getIsolatedConnection(login, password) End Select ConnecterSource.autoCommit = false

if IsNull(ConnecterSource) then MsgBox("Connexion impossible",16) End if End Function

Pour me déconnecter, j'utilise celle-ci:

'Si i est a 0, pas de confirmation Sub DeconnecterSource(maConnexion as Object, i as Integer) if i = 0 then maConnexion.Commit else if MsgBox("Êtes-vous sûre?",32+4)=6 then maConnexion.Commit else maConnexion.rollback end if end if

maConnexion.autoCommit = true maConnexion.close maConnexion.dispose End Sub