• Update in remote database (Access 2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Update in remote database (Access 2000)

    Author
    Topic
    #391750

    Can somebody help me?

    I need to open a remote database and write the number 1987742 in

    the field affiliates of the table bank.

    To this end i have built the folloiwng function

    Public Function UpdateFieldAffiliate()
    Dim StrPassword As String
    StrPassword = “secret”
    Dim db As DAO.Database
    Set db = DBEngine.Workspaces(0).OpenDatabase(BEpath,

    dbDriverComplete, False, “; PWD=” & StrPassword)
    Dim StrVa As String
    StrVa = ” UPDATE bank SET affiliates = 1987742″
    CurrentDb.Execute StrVa
    End Function

    However i receive the error in the line CurrentDb.execute StrVa.
    It is clear to me that the database is not current but remote, and

    hence the error.But how can i rewrite it?

    Viewing 0 reply threads
    Author
    Replies
    • #700911

      The answer is staring you into the eye. You should use db.Execute instead of CurrentDb.Execute, since you want the update to be executed in the remote database, not in the current database.

    Viewing 0 reply threads
    Reply To: Update in remote database (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: