Hello,
I have a problem with Base, I created a macro but, if the file location
changes, the macro doesn't work, I wanted to know how to fix this problem
if possible..

I join you my macro:
Sub CambiarNombreEstanteria
        Dim oDBContext As Object , oDB As Object , oBase As Object
        Dim oStatement As Object , oRequete As Object
        Dim strSQL As String

        'On se connecte à la base de données référencées
        oDBContext = CreateUnoService("com.sun.star.sdb.DatabaseContext")
        oDB = oDBContext.getbyName("DocProyectosV1")

        'La base est sans login/password
        oBase = oDB.getConnection("","")

        'On prépare la requête
        oStatement = oBase.createStatement()

        'On saisit la requête que l'on stocke dans la chaine strSQL
        'A noter, chaque " doit être doublé et la requête SQL doit être
entre ".
        Dim a as String, b as string
        b= InputBox ("Apunta el nombre de la estanteria que quieres
renomar","Nombre actual de la estanteria")
        a= InputBox ("Apunta el nuevo nombre de la estanteria","Nuevo
nombre de la estanteria")
        strSQL= "UPDATE ""Documento"" SET ""Estanteria"" ="+a+" WHERE
""Estanteria""="+b

        'On exécute la requête SQL
        oRequete = oStatement.executeQuery( strSQL )
        'On ferme proprement les appels
        oRequete.Close
        oStatement.Close
        oBase.Close
        oBase.Dispose
  End Sub

Thanks for your help,
Have a good day!

-- 
To unsubscribe e-mail to: website+unsubscr...@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/website/
All messages sent to this list will be publicly archived and cannot be deleted

Reply via email to