Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Update in remote database (Access 2000)

    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?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Update in remote database (Access 2000)

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •