The Access Web: API: Get Version of Office Exes

  • Thread starter Thread starter JulieD
  • Start date Start date
J

JulieD

Hi All

i'm trying to use the code of this site to return the version of access that
is being used. I want this displayed in a form. I've managed to
successfully do this in the past when i was working on access 2000. Now i'm
using access2003 to develop an mdb and having problems with
fGetProductVersion(SysCmd(acSysCmdAccessDir) & "msaccess.exe")
returning a #name error

Would appreciate any advice.

Regards
JulieD
PS sorry if this isn't the appropriate group .. couldn't figure out which
group i should post to on this question.
 
The code works fine for me using Access 2003, so I suspect there's something
else going on.

One of the most common reasons why code suddenly stops working is problems
with the References in the database.

These can be caused by differences in either the location or file version of
certain files between the machine where the application was developed, and
where it's being run (or the file missing completely from the target
machine). Such differences are common when new software is installed.

On the machine(s) where it's not working, open any code module and select
Tools | References from the menu bar. Examine all of the selected
references.

If any of the selected references have "MISSING:" in front of them, unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back out
of the dialog, then go back in and unselect the reference you just added. If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)

For far more than you could ever want to know about this problem, check out
http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html
 
Hi Doug

thanks for the response, i've gone through all of the references and can't
see anything amiss. When i call the function from a form using

=fGetProductVersion(SysCmd([acSysCmdAccessDir]) & "MSAccess.exe")
i get a #NAME error
however using
?fGetProductVersion(SysCmd([acSysCmdAccessDir]) & "MSAccess.exe")
in the intermediate window
returns 11.0.5614.0
additionally, i'm also using
=fGetProductVersion(fReturnSysDir() & "\msjet40.dll")
and
=fGetProductVersion(fReturnSysDir() & "\msjet35.dll")

and they're working fine ... any other ideas.

Cheers
JulieD
 
Son of a gun: I get the same error when I set the control source for a
textbox to that function call! Afraid I can't think of any reason why off
the top of my head, but I was able to get around it by putting code into the
form's Current event:

Private Sub Form_Current()
Me.Text0 = fGetProductVersion(SysCmd([acSysCmdAccessDir]) &
"MSAccess.exe")
End Sub

You'll have to lock the field, though, if you don't want the user to be able
to key over the value if you use this approach.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



JulieD said:
Hi Doug

thanks for the response, i've gone through all of the references and can't
see anything amiss. When i call the function from a form using

=fGetProductVersion(SysCmd([acSysCmdAccessDir]) & "MSAccess.exe")
i get a #NAME error
however using
?fGetProductVersion(SysCmd([acSysCmdAccessDir]) & "MSAccess.exe")
in the intermediate window
returns 11.0.5614.0
additionally, i'm also using
=fGetProductVersion(fReturnSysDir() & "\msjet40.dll")
and
=fGetProductVersion(fReturnSysDir() & "\msjet35.dll")

and they're working fine ... any other ideas.

Cheers
JulieD

Douglas J. Steele said:
The code works fine for me using Access 2003, so I suspect there's
something
else going on.

One of the most common reasons why code suddenly stops working is problems
with the References in the database.

These can be caused by differences in either the location or file version
of
certain files between the machine where the application was developed, and
where it's being run (or the file missing completely from the target
machine). Such differences are common when new software is installed.

On the machine(s) where it's not working, open any code module and select
Tools | References from the menu bar. Examine all of the selected
references.

If any of the selected references have "MISSING:" in front of them,
unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back
out
of the dialog, then go back in and unselect the reference you just added.
If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)

For far more than you could ever want to know about this problem, check
out
http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Now
i'm
 
Hi Doug

well i'm glad it's not just me (i can't believe that i "wasted" about
2hrs(plus) on that problem!) ... it also solves my next problem where
Mid(DBEngine.Workspaces(0).[Databases](0).[TableDefs]("USysSIDatabase").[Connect],
11)

doesn't work in a text box on the form anymore, but does when i put it in
the form_current event!

Cheers
JulieD

Douglas J. Steele said:
Son of a gun: I get the same error when I set the control source for a
textbox to that function call! Afraid I can't think of any reason why off
the top of my head, but I was able to get around it by putting code into
the
form's Current event:

Private Sub Form_Current()
Me.Text0 = fGetProductVersion(SysCmd([acSysCmdAccessDir]) &
"MSAccess.exe")
End Sub

You'll have to lock the field, though, if you don't want the user to be
able
to key over the value if you use this approach.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



JulieD said:
Hi Doug

thanks for the response, i've gone through all of the references and
can't
see anything amiss. When i call the function from a form using

=fGetProductVersion(SysCmd([acSysCmdAccessDir]) & "MSAccess.exe")
i get a #NAME error
however using
?fGetProductVersion(SysCmd([acSysCmdAccessDir]) & "MSAccess.exe")
in the intermediate window
returns 11.0.5614.0
additionally, i'm also using
=fGetProductVersion(fReturnSysDir() & "\msjet40.dll")
and
=fGetProductVersion(fReturnSysDir() & "\msjet35.dll")

and they're working fine ... any other ideas.

Cheers
JulieD

Douglas J. Steele said:
The code works fine for me using Access 2003, so I suspect there's
something
else going on.

One of the most common reasons why code suddenly stops working is problems
with the References in the database.

These can be caused by differences in either the location or file version
of
certain files between the machine where the application was developed, and
where it's being run (or the file missing completely from the target
machine). Such differences are common when new software is installed.

On the machine(s) where it's not working, open any code module and select
Tools | References from the menu bar. Examine all of the selected
references.

If any of the selected references have "MISSING:" in front of them,
unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back
out
of the dialog, then go back in and unselect the reference you just added.
If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)

For far more than you could ever want to know about this problem, check
out
http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Hi All

i'm trying to use the code of this site to return the version of
access
that
is being used. I want this displayed in a form. I've managed to
successfully do this in the past when i was working on access 2000. Now
i'm
using access2003 to develop an mdb and having problems with
fGetProductVersion(SysCmd(acSysCmdAccessDir) & "msaccess.exe")
returning a #name error

Would appreciate any advice.

Regards
JulieD
PS sorry if this isn't the appropriate group .. couldn't figure out which
group i should post to on this question.
 
It's the square brackets, and, more particularly, the
named constant acSysCmdAccessDir that is confusing it.

You can't use variables or constants or objects or
object properties or whatever there, and you can't
use them in square brackets, and the brackets are
an indication of the problems that you have there.

This works too:

=fGetProductVersion(SysCmd(9) & "MSAccess.exe")

(david)


JulieD said:
Hi Doug

thanks for the response, i've gone through all of the references and can't
see anything amiss. When i call the function from a form using

=fGetProductVersion(SysCmd([acSysCmdAccessDir]) & "MSAccess.exe")
i get a #NAME error
however using
?fGetProductVersion(SysCmd([acSysCmdAccessDir]) & "MSAccess.exe")
in the intermediate window
returns 11.0.5614.0
additionally, i'm also using
=fGetProductVersion(fReturnSysDir() & "\msjet40.dll")
and
=fGetProductVersion(fReturnSysDir() & "\msjet35.dll")

and they're working fine ... any other ideas.

Cheers
JulieD

Douglas J. Steele said:
The code works fine for me using Access 2003, so I suspect there's
something
else going on.

One of the most common reasons why code suddenly stops working is problems
with the References in the database.

These can be caused by differences in either the location or file version
of
certain files between the machine where the application was developed, and
where it's being run (or the file missing completely from the target
machine). Such differences are common when new software is installed.

On the machine(s) where it's not working, open any code module and select
Tools | References from the menu bar. Examine all of the selected
references.

If any of the selected references have "MISSING:" in front of them,
unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back
out
of the dialog, then go back in and unselect the reference you just added.
If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)

For far more than you could ever want to know about this problem, check
out
http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Now
i'm
 
Hi David

i couldn't get
=fGetProductVersion(SysCmd(9) & "MSAccess.exe")
to work as the control source in a text box ...

Cheers
JulieD


david epsom dot com dot au said:
It's the square brackets, and, more particularly, the
named constant acSysCmdAccessDir that is confusing it.

You can't use variables or constants or objects or
object properties or whatever there, and you can't
use them in square brackets, and the brackets are
an indication of the problems that you have there.

This works too:

=fGetProductVersion(SysCmd(9) & "MSAccess.exe")

(david)


JulieD said:
Hi Doug

thanks for the response, i've gone through all of the references and
can't
see anything amiss. When i call the function from a form using

=fGetProductVersion(SysCmd([acSysCmdAccessDir]) & "MSAccess.exe")
i get a #NAME error
however using
?fGetProductVersion(SysCmd([acSysCmdAccessDir]) & "MSAccess.exe")
in the intermediate window
returns 11.0.5614.0
additionally, i'm also using
=fGetProductVersion(fReturnSysDir() & "\msjet40.dll")
and
=fGetProductVersion(fReturnSysDir() & "\msjet35.dll")

and they're working fine ... any other ideas.

Cheers
JulieD

Douglas J. Steele said:
The code works fine for me using Access 2003, so I suspect there's
something
else going on.

One of the most common reasons why code suddenly stops working is problems
with the References in the database.

These can be caused by differences in either the location or file version
of
certain files between the machine where the application was developed, and
where it's being run (or the file missing completely from the target
machine). Such differences are common when new software is installed.

On the machine(s) where it's not working, open any code module and select
Tools | References from the menu bar. Examine all of the selected
references.

If any of the selected references have "MISSING:" in front of them,
unselect
them, and back out of the dialog. If you really need the reference(s) you
just unselected (you can tell by doing a Compile All Modules), go back in
and reselect them.

If none have "MISSING:", select an additional reference at random, back
out
of the dialog, then go back in and unselect the reference you just added.
If
that doesn't solve the problem, try to unselect as many of the selected
references as you can (Access may not let you unselect them all), back out
of the dialog, then go back in and reselect the references you just
unselected. (NOTE: write down what the references are before you delete
them, because they'll be in a different order when you go back in)

For far more than you could ever want to know about this problem, check
out
http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Hi All

i'm trying to use the code of this site to return the version of
access
that
is being used. I want this displayed in a form. I've managed to
successfully do this in the past when i was working on access 2000. Now
i'm
using access2003 to develop an mdb and having problems with
fGetProductVersion(SysCmd(acSysCmdAccessDir) & "msaccess.exe")
returning a #name error

Would appreciate any advice.

Regards
JulieD
PS sorry if this isn't the appropriate group .. couldn't figure out which
group i should post to on this question.
 
Back
Top