4 messages in org.openoffice.fr.prog[prog] OOo1.1.3: Remplir une listbox ...
FromSent OnAttachments
Ludovic CHEVALIERDec 21, 2004 5:19 am 
LE LOUARNE SergeDec 21, 2004 7:44 am 
Agnès SimonetDec 21, 2004 8:24 am 
Ludovic CHEVALIERDec 22, 2004 3:49 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] OOo1.1.3: Remplir une listbox de boîte de dialogue avec une requête sqlActions...
From:Ludovic CHEVALIER (tens@no-log.org)
Date:Dec 21, 2004 5:19:40 am
List:org.openoffice.fr.prog

Bonjour, Je travaille sur une BDD SQLite. J'ai créé une boîte de dialogue avec une listBox dont je souhaiterai que le
contenu soit les données d'un de mes champs. On m'a donné une base sur laquelle réfléchir, mais je ne m'en sort pas tout
seul. Notamment en ce qui concerne la dim de Statement qui pose problème à l'execution
(boite d'erreur qui s'ouvre). J'ntincipe aussi sur la suite. L'exemple qui m'était donné fait mention d'une "variable" nommée "sMySQLString"
dont je ne connais ni la dimension (string à priori), ni l'usage, ni si c'est spécifique
à MySQL, ou bien s'il s'agit d'un nom comme un autre. Voici où j'en suis:

Sub RemplirListBox dim Statement as object dim ResultSet as object dim oListBox as object dim oDialog as object dim Connection as object dim sMySQLString as string

oDialog = createUnoDialog(DialogLibraries.Standard.fForDruck) oListBox = oDialog.getControl("FB_List1") Statement = Connection.createStatement() ResultSet = Statement.executeQuery("select Code_Projet from Arbo") If Not IsNull(ResultSet) Then While (ResultSet.next) For i = 1 To 1 sMySQLString = ResultSet.getString(i) oListBox = oDialog.getControl("FB_Liste1") oListBox.addItem( sMySQLString, 1 ) Next i Wend End If oDialog.execute() End Sub

Voilà. Vous avez des idées???

Merci,

Ludo