🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: microsoft.public.vb.database.dao
Article #5

run macros in Access 7.0 from VB 4.0

#5
From: antonio garcia cabeza
Date: Thu, 11 Dec 1997 00:00
31 lines
2134 bytes
I�m running Access 7.0 an VBBASIC 4.0 on Windows 95 system
My database has a security.
I create a macro in Access and then I run the macro from vb.

Private Sub ACEPTARIMP_Click()

Dim MiBD As Database, Acobject As Object

Set Acobject = GetObject("q :\base.mdb")


Set MiBD = gwsMainWS.OpenDatabase("q:\ base.mdb ")
�gwsMainWS is the Workspace I�m working from
Acobject.Application.Visible = False
Acobject.DoCmd.SetWarnings False

Acobject.DoCmd.RunMacro "IMPORTAR", , ""

Acobject.DoCmd.SetWarnings True

The code opens an Access sesion and I find Two problems :

- Access is open in a visible way eventhough I use the sentence
Acobject.Application.Visible = False

-The new Access sesion is joined to the default workspace in the PC and
the default user is admin although I�m in another wokspace and with
another user from Visual Basic.

Can someone help me ?
Technical Details
Message-ID: <349000B8.C73FFFD0@cyberweb.es>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 104586,30a06437432721ec,start
X-Google-Attributes: gid104586,public
X-Google-Thread: 1053fc,30a06437432721ec,start
X-Google-Attributes: gid1053fc,public
X-Google-Thread: ff0ac,30a06437432721ec,start
X-Google-Attributes: gidff0ac,public
X-Google-Thread: 10644a,30a06437432721ec,start
X-Google-Attributes: gid10644a,public
X-Google-Thread: f9608,30a06437432721ec,start
X-Google-Attributes: gidf9608,public
X-Google-Thread: f4e95,30a06437432721ec,start
X-Google-Attributes: gidf4e95,public
X-Google-Thread: 10be7f,30a06437432721ec,start
X-Google-Attributes: gid10be7f,public
X-Google-Thread: f962e,30a06437432721ec,start
X-Google-Attributes: gidf962e,public
From: antonio garcia cabeza <garcia@cyberweb.es>
Subject: run macros in Access 7.0 from VB 4.0
Date: 1997/12/11
Message-ID: <349000B8.C73FFFD0@cyberweb.es>
X-Deja-AN: 297241576
Organization: Unisource Espana NEWS SERVER
Reply-To: garcia@cyberweb.es
Newsgroups: microsoft.public.vb.database.dao,es.comp.lenguajes.visual-basic,microsoft.public.vb.database,microsoft.public.vb.ole,microsoft.public.vb.ole.automation,microsoft.public.vb.syntax,comp.databases.ms-access,microsoft.public.access.security