Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2005

Tip: Looking for answers? Try searching our database.

calling functions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dave - 07 Apr 2005 06:20 GMT
Hi
I am building one application in ms access 2003.
what basically does is it execute some function of other database. to achieve this i had put all functions in startup of other database...
(i.e. function is called in form loading event and form is setup as startup object)
logic is something like this in main application..

while 'schedular is not finished
   'execute statement 1

   'below things will open the other database and it will execute all function in start up event

   Shell "C:\Program Files\Microsoft Office\Office11\msaccess.exe C:\PR\db1\PRCOPY.mdb", vbNormalFocus

   statement 2
   statement 3

wend

i m getting two problem with this..

first is its execute statement2 even the above statement execution (executing function of other database) is not finished...i want to stop execution of  prog until it finsih it..
second is all variable are goes out of scope once it start executing other database..

can any one suggest me how to handle this thing? i cant merge other database function in my main application..
any help would be appreciated..
thanx in advance
dave
Michel Walsh - 07 Apr 2005 12:22 GMT
Hi,

For the first problem, you can use WaitForSingleObject
(http://support.microsoft.com/default.aspx?scid=kb;en-us;178116).

For the second problem, processes are isolated, so one can crash, without
crashing the others. There are possibilities of inter-processes
communication, though, such as Windows message, DCOM, file (on hard disk or
in memory),... and data in database. .

Hoping it may help,
Vanderghast, Access MVP

Hi
I am building one application in ms access 2003.
what basically does is it execute some function of other database. to
achieve this i had put all functions in startup of other database...
(i.e. function is called in form loading event and form is setup as startup
object)
logic is something like this in main application..

while 'schedular is not finished
   'execute statement 1

   'below things will open the other database and it will execute all
function in start up event

   Shell "C:\Program Files\Microsoft Office\Office11\msaccess.exe
C:\PR\db1\PRCOPY.mdb", vbNormalFocus

   statement 2
   statement 3

wend

i m getting two problem with this..

first is its execute statement2 even the above statement execution
(executing function of other database) is not finished...i want to stop
execution of  prog until it finsih it..
second is all variable are goes out of scope once it start executing other
database..

can any one suggest me how to handle this thing? i cant merge other database
function in my main application..
any help would be appreciated..
thanx in advance
dave
dave - 08 Apr 2005 04:49 GMT
Thanx Michel
Your suggested solution really worked.
But only problem now is its raise Err.number 91 when shell command executed
and I think that variable goes out of context.
Any suggestion
Thanx again
dave

> Hi,
>
[quoted text clipped - 44 lines]
> thanx in advance
> dave
dave - 08 Apr 2005 05:57 GMT
Hi Michel

One more strang thing that if you execute function by passing value it
works...but if you store value in variable and call the function it doesnt
work..

'This code doesnt work...
                   MyStr = "C:\PR\db1\PRCOPY.mdb"
                   StrPath = "C:\Program Files\Microsoft
Office\Office11\msaccess.exe " & MyStr
                   MsgBox Eval(StrPath)
                   ExecCmd Eval(StrPath)
'This code works
                   ExecCmd "C:\Program Files\Microsoft
Office\Office11\msaccess.exe C:\PR\db1\PRCOPY.mdb"
                   ExecCmd Eval(StrPath)

Any idea..
This prob driving me crazy...
Thanx
dave

> Hi,
>
[quoted text clipped - 44 lines]
> thanx in advance
> dave
Michel Walsh - 08 Apr 2005 11:26 GMT
Hi,

   I suspect, at first glance, a problem of space. If, in a command window,
you type

a  b

it understand to run application (command) name a, with argument b. So, with

C:\Program  Files

as example, you try to run an application Program  with the argument  Files.
If the path name has space, in such case, you can try to use " " :

"C:\Program Files\ApplicationA"  argument

which, written in a string, becomes

Dim str As String
   str = """C:\Program Files\ApplicationA""  argument"

Hoping it may help,
Vanderghast, Access MVP

> Hi Michel
>
[quoted text clipped - 70 lines]
>> thanx in advance
>> dave
dave - 11 Apr 2005 07:56 GMT
Thanx Michel
It worked...
Thanx for your help...appreciated...
Cheers
dave

> Hi,
>
[quoted text clipped - 94 lines]
> >> thanx in advance
> >> dave
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.