Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


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: users+unsubscribe@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/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.