Forum Discussion

Alexdaner's avatar
Alexdaner
New Contributor
3 years ago

Test form inside Microsoft Access accdb file Error

When I'm trying to open database using OpenCurrentDatabase method - I'm getting error. I need to test forms. Not change DB. Check functionality of the form. Code:     function Acess_Test() { ...
  • rraghvani's avatar
    3 years ago

    Use double backslash when referring to file path,

     

    function Acess_Test() {
        MsAccess = Sys.OleObject("Access.Application");
        MsAccess.Visible = true;
        FileName = "C:\\Public\\Database2.accdb"; // <-- Use double backslash
        MsAccess.OpenCurrentDatabase(FileName);
    }