37 messages in org.openoffice.fr.progRe: [prog] Atteindre le dernier enreg...
FromSent OnAttachments
Arnaud LAURENSON - Costes GestionAug 24, 2005 7:07 am 
Christophe LiénardAug 24, 2005 9:18 am 
chris drauxAug 24, 2005 11:09 am 
JovialAug 24, 2005 1:06 pm 
Bernard MarcellyAug 24, 2005 11:31 pm 
Christophe LiénardAug 25, 2005 12:16 am 
Arnaud LAURENSON - Costes GestionAug 25, 2005 12:38 am 
RedletAug 25, 2005 12:43 am 
Arnaud LAURENSON - Costes GestionAug 25, 2005 12:46 am 
RedletAug 25, 2005 1:07 am 
Christophe LiénardAug 25, 2005 1:14 am 
Arnaud LAURENSON - Costes GestionAug 25, 2005 1:28 am 
Arnaud LAURENSON - Costes GestionAug 25, 2005 1:37 am 
RedletAug 25, 2005 1:38 am 
Alex ThurgoodAug 25, 2005 1:47 am 
Arnaud LAURENSON - Costes GestionAug 25, 2005 2:09 am 
Arnaud LAURENSON - Costes GestionAug 25, 2005 2:38 am 
JovialAug 25, 2005 2:41 am 
Christophe LiénardAug 25, 2005 3:34 am 
Alex ThurgoodAug 25, 2005 4:00 am 
Bernard MarcellyAug 25, 2005 4:20 am 
Arnaud LAURENSON - Costes GestionAug 25, 2005 4:51 am 
Christophe LiénardAug 26, 2005 5:32 am 
Bernard MarcellyAug 26, 2005 7:29 am 
Christophe LiénardAug 26, 2005 7:43 am 
Bernard MarcellyAug 26, 2005 9:09 am 
Christophe LiénardAug 29, 2005 12:19 am 
Didier LarocheSep 22, 2005 11:15 am 
Christophe LiénardSep 23, 2005 12:41 am 
FRBSep 23, 2005 4:49 am 
Marie jo KOPP CASTINELSep 23, 2005 6:03 am 
Alain NowakSep 26, 2005 12:41 am 
Fred...@equipement.gouv.frSep 26, 2005 4:53 am 
Christophe LiénardSep 26, 2005 5:29 am 
Alain NowakSep 26, 2005 5:29 am 
Laurent GodardSep 26, 2005 5:54 am 
Fred...@equipement.gouv.frSep 26, 2005 6:22 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:Re: [prog] Atteindre le dernier enregistrementActions...
From:Jovial (o.jo@free.fr)
Date:Aug 24, 2005 1:06:38 pm
List:org.openoffice.fr.prog

Sous OOo 1.1.2, en adaptant ton code sur une de mes macros cela marche ci dessous le code

'Connection à la source de données maSource=oDBContext.getbyname(NomSource) MaConnexion=maSource.getConnection("","")

SQL = "SELECT * FROM "& NomTableAdr LaRequete=MaConnexion.createStatement() LaRequete.QueryTimeout=30 LeResultSet=laRequete.executeQuery(SQL) 'Lecture du premier enregistrement

With LeResultSet LeResultat = .Last '.Next if LeResultat then print LeResultSet.getstring(2) end if End with 'print LeResultSet.getColumns.getbyindex(0).string

MaConnexion.close MaConnexion.dispose End Sub

Sur quelle ligne tu plantete, quel message? Bonne suite

jean-luc

Arnaud LAURENSON - Costes Gestion a écrit :

Enfin, je viens d'avoir la bible "Macros OooBasic et API". Enfin, je me rue sur la page 539 pour pouvoir atteindre le dernier enregistrement d'une requête.

je dois être très fatigué mais j'ai systématiquement un msg d'erreur après l'application du code suivant :

SQL = "SELECT * FROM toto" oRech = oStatement.executeQuery(SQL) 'j'ai défini oStatement avant With oRech execOK = .last if execOK then msgbox oRech.getstring(1) end if end With Ca ne passe pas avec la méthode Last qu'il ne reconnaît pas (j'ai essayé avec .Next et là ça fonctionne). Quelqu'un peut-il m'éclairer sur ce point SVP ? Merci d'avance.