Determine lastest minor version of A2007 in VBA

S

Song Su

I have the latest Access 2007 Version (12.0.6211.1000) SP1 MSO
(12.0.6320.5000)

My filedatetime() works on my machine but not other machine with SP1. I
guess it's the minor hotfix (12.0.6320.5000) makes the difference.

How to detect user's Access version and MSO number in VBA?

Thanks
 
D

Douglas J. Steele

Actually, I doubt it's directly related to Access itself. I suspect your
References collection is messed up.

References problems 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, take a look at the References
collection.

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)
 
S

Song Su

I compile my frontend, put accde on network. Users double click a shortcut
which will copy accde from network to their C drive and run. Do you mean I
have to check each user's machine for reference?
 
R

Rick Brandt

I compile my frontend, put accde on network. Users double click a
shortcut which will copy accde from network to their C drive and run. Do
you mean I have to check each user's machine for reference?

Yes. At least if you are using anything but the default references (bad
idea).
 
D

Douglas J. Steele

As Rick says, yes, you need to check the references on every machine where
the application isn't working.

Unfortunately, it's not that easy to do with accde files, as you cannot get
to the References collection in them. Instead, on your development machine,
check the accdb to determine the location of each file you're referencing.
Once you know the location of each referenced file, check the files to find
out the exact version of each. Once you know that, check that the same
version of the files exist in the same locations on the user machines.
 
T

Tony Toews [MVP]

To follow up on Doug's posting about references what references do you
currently have?

Sub ViewReferenceDetails()

Dim ref As Reference

For Each ref In Access.References
Debug.Print ref.Name & " - " & ref.Major & "." & ref.Minor & "
- " & ref.FullPath
Next ref

End Sub

Run the above code and post the debug results here.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
S

Song Su

Tony Toews said:
To follow up on Doug's posting about references what references do you
currently have?

Sub ViewReferenceDetails()

Dim ref As Reference

For Each ref In Access.References
Debug.Print ref.Name & " - " & ref.Major & "." & ref.Minor & "
- " & ref.FullPath
Next ref

End Sub

Run the above code and post the debug results here.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/

VBA - 4.0 - C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL
Access - 9.0 - C:\Program Files\Microsoft Office\Office12\MSACC.OLB
stdole - 2.0 - C:\Windows\system32\stdole2.tlb
ADODB - 2.5 - C:\Program Files\Common Files\System\ado\msado25.tlb
DAO - 12.0 - C:\PROGRA~1\COMMON~1\MICROS~1\OFFICE12\ACEDAO.DLL
VBIDE - 5.3 - C:\Program Files\Common Files\Microsoft
Shared\VBA\VBA6\VBE6EXT.OLB
Outlook - 9.3 - C:\Program Files\Microsoft Office\Office12\MSOUTL.OLB
MSACAL - 7.0 - C:\PROGRA~1\MICROS~1\Office12\MSCAL.OCX
 
D

Douglas J. Steele

You'll find distribution will be much easier if you don't have the
references to Outlook or the calendar control.

For the calendar, use one of the many alternatives Jeff Conrad lists at
http://www.accessmvp.com/JConrad/accessjunkie/calendars.html

For Outlook, once you've got your code working, switch to using Late
Binding.

As well, unless you're using both ADO and DAO in your code, remove whichever
of the two references you're not using.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)
 
T

Tony Toews [MVP]

Song Su said:
VBIDE - 5.3 - C:\Program Files\Common Files\Microsoft
Shared\VBA\VBA6\VBE6EXT.OLB

You also probably don't need the above reference either.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
S

Song Su

Dear Douglas,

I removed ADO and VBIDE and my application seems working fine. I use Access
2007 for both front and back end. Since I'm new to reference and I do use
outlook in my application, what do you mean 'late binding'? Do you have any
suggested reading?

Thanks.

Song
 
T

Tony Toews [MVP]

Song Su said:
Since I'm new to reference and I do use
outlook in my application, what do you mean 'late binding'? Do you have any
suggested reading?

Late binding means you can safely remove the reference and only have
an error when the app executes lines of code in question. Rather than
erroring out while starting up the app and not allowing the users in
the app at all. Or when hitting a mid, left or trim function call.

This also is very useful when you don't know version of the external
application will reside on the target system. Or if your organization
is in the middle of moving from one version to another.

For more information including additional text and some detailed links
see the "Late Binding in Microsoft Access" page at
http://www.granite.ab.ca/access/latebinding.htm

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top