Base problem

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!

Hi Yohann,

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..

Which file location are you talking about :
- the location of the macro ?
- the location of the Base (ODB) file ?

You don't mention from where or how (i.e. on which event) in the ODB
file your macro is run - this is important (main form, subform, on
application open, standalone Writer document, etc).

Alex