C'est une version un peu obsolète. Je te conseille de la désinstaller et d'installer la beta2 (=m125) ou la m128. Un certain nombre de bugs ont pu être corrigés et des avancées effectuées entre les versions. La désinstallation préalable est importante pour une bonne installation d'une nouvelle version je crois.

Oui effectivement d'après le post suivant le code a changé depuis la m79
http://www.oooforum.org/forum/viewtopic.phtml?t=19625&highlight=data+source
Donc le code de Florent ne marche pas sur ma version

Il me reste plus qu'à aller squatter un PC en Haut débit pour un update., "Allo Monique je peux te voir" ;-)


merci à tous  à + :-)

Jluc

Pour info le code récupéré:

Sub nova_DataSource
  oContexto = createUnoService("com.sun.star.sdb.DatabaseContext")
  If oContexto.hasByName("Minha_Fonte") Then
     msgBox "Já existe"
  Else
     oFonte = createUnoService("com.sun.star.sdb.DataSource")
sUrl = ConvertToURL("C:\Documents and Settings\User1\My Documents\ooo2b")
     ' OK for 1.9.79 - error with 1.9.104
     ' oFonte.storeAsURL(sUrl & "/novaFonte_104.odb", Array())
     '
     ' With 1.9.104 use DatabaseDocument property of DataSource
oFonte.DatabaseDocument.storeAsURL(sUrl & "/novaFonte_104.odb", Array())
     sUrl = "sdbc:dbase:" & sUrl
     oContexto.registerObject("Minha_Fonte", oFonte)
     oFonte.setPropertyValue("URL", sUrl)
     ' OK with 1.9.79 - error with 1.9.104
     ' oFonte.store()
     oFonte.DatabaseDocument.store()
  End If
End Sub

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Répondre à