2 messages in org.openoffice.fr.progRe: [prog] Créer une source en mémoir...
FromSent OnAttachments
JovialJan 23, 2008 4:30 am 
Serge LE LOUARNEJan 23, 2008 4:46 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] Créer une source en mémoire sans odbActions...
From:Serge LE LOUARNE (serg@gmail.com)
Date:Jan 23, 2008 4:46:21 am
List:org.openoffice.fr.prog

Bonjour,

A quel niveau as-tu un problème ? Pourquoi ne pas créer une table ou vue "temporaire" que tu détruit en fin d'utilisation ?

Le 23/01/08, Jovial <o.jo@free.fr> a écrit :

Bonjour

J'aimerai créer une source en mémoire le temps de l'existence du document. J'ai trouvé un exemple qui repose sur l'existence d'un cvs mais dans mon cas il s'agirai du résultat d'une requête (ou d'un tableau)

exemple trouvé sur: http://www.mail-archive.com/prog@fr.openof@

Créer une source de donnée à partir d'un fichier CVS ' Function CreerSourceSurCSV(cheminCSV as String, _ decimalDel as String, champDel as String, ChaineDel as String, _ optional extension as string) as Variant

dim monDBContext As Object, uneInstance as Object dim chemin as String dim info(3) as New com.sun.star.beans.PropertyValue

if isMissing(extension) then extension = "csv"

CreerSourceSurCSV = null

monDBContext = CreateUnoService("com.sun.star.sdb.DatabaseContext")

chemin = ConvertToUrl(cheminCSV) uneInstance = monDBContext.CreateInstance() uneInstance.URL = "sdbc:flat:" & chemin info(0).Name = "DecimalDelimiter" info(0).Value = decimalDel info(1).Name = "Extension" info(1).Value = extension info(2).Name = "FieldDelimiter" info(2).Value = champDel info(3).Name = "StringDelimiter" info(3).Value = chaineDel uneInstance.info() = info

CreerSourceSurCSV = uneInstance end Function