473,793 Members | 2,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Evaluating References in Code [Long]

I've got an adp (Metrix.adp) with a reference to another adp
(InteractSQL.ad p). InteractSQL sits on a server, and is refered to by
all of the clients (Metrix), which sit on the client machines (There's
also a SQL Server that sits on the server, but that's besides the point
here.). Both adp files have references to ADOX. I've got to check
Metrix has an older version of ADOX, and react appropriately. I've
written code to do this, and it looks like it should work. But it
doesn't and I can't figure out why.

I would love any thoughts on what might be going wrong with my code. I
would also love any thoughts on other ways that I could go about
assessing what version of ADOX is being refered to in an adp to which
I have a reference set. Another way to go about this would be to figure
out what version of MDAC is on another computer on the network.

The code (below) runs in Metrix, and walks the collection of references
in that file. When it encounters the ADOX reference, it just gathers
the version. When it encounters the InteractSQL reference, it then
walks the reference collection of that object, again gathering the
version number when it finds the ADOX reference.

I've got two machines set up. The client machine has a reference to
ADOX 2.7 in the Metrix file. The InteractSQL file on the server has a
reference to ADOX 2.8 (a scenario we encounter a lot at client sites).
But the code reports back that they are both 2.7. When I go back to
InteractSQL.adp , though, it's reference is clearly still set to 2.8.

Thanks much for any help on this.

Jeremy
--
Jeremy Wallace
Fund for the City of New York

Function fnInteractRepor tRefsValid() As Boolean
On Error GoTo Error
Dim refParent As Access.Referenc e
Dim appChildDB As Application
Dim refChild As Access.Referenc e
Dim lngParentVersio n As Long
Dim lngChildVersion As Long
Dim strInteractFile As String

'Can't know how the references will be named, so get rid of the
extension, if it's there
strInteractFile = Replace(INTERAC TFILE, ".adp", "")

'Walk the collection of references set in Metrix.adp
For Each refParent In References
If refParent.Name = "ADOX" Then
'Gather the local mdac version, which we'll later compare to
the one in interact.
lngParentVersio n = CLng(refParent. Major & "." &
refParent.Minor )
ElseIf refParent.Name Like "*" & strInteractFile & "*" Then
If refParent.IsBro ken = True Then
'Report back if it's broken.
fnInteractRepor tRefsValid = False
Else
'Gather the version of mdac refered to in InteractSQL.adp .
Set appChildDB = New Access.Applicat ion
Call appChildDB.Open AccessProject(r efParent.FullPa th)
For Each refChild In appChildDB.Refe rences
If refChild.Name = "ADOX" Then
lngChildVersion = CLng(refChild.M ajor & "." &
refChild.Minor)
End If
Next refChild
appChildDB.Clos eCurrentDatabas e
End If
End If
Next refParent

If lngChildVersion > lngParentVersio n Then
'Do some stuff
End If

ExitPoint:
On Error Resume Next
'Clean-up code

Exit Function
Error:
'Error handling
End Function

Dec 1 '05
30 2490
david epsom dot com dot au wrote:
I offer the following code because I continue to be
unconvinced of the need for something more complex:

Private Declare Function GetFileVersionI nfo& Lib "Version" Alias
"GetFileVersion InfoA" (ByVal FileName$, ByVal lptr&, ByVal lSize&, lpvData
As Any)
Public Function gfn_GetVersion( FileName$)
'2003/02/26 dlg --minimalist version -- Right to attribution retained
Dim iBuf(0 To 99) As Integer

Call GetFileVersionI nfo(FileName$, 0&, 200, iBuf(0))
gfn_GetVersion = iBuf(25) & "." & iBuf(24) & "." & iBuf(27) & "." &
iBuf(26) 'FILE VERSION

End Function


Very nice!

--
Lyle Fairfield
Dec 5 '05 #31

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

33
2404
by: JKop | last post by:
I understand variables/objects and pointer variables perfectly: int X = 5; int* pX = &X; *pX = 4; int** ppX = &pX:
25
6213
by: Steve Jorgensen | last post by:
Yup, Steve's full of tips, but hey, it makes him feel important, right? Ok, here goes. I've been trying to improve encapsulation by putting code in the same object as the stuff it affects, so I rarely refer to a subform ir parent form's controls or records from the other form. Instead, I call a procedure in that form that does the job. That's all fine and good, and nothing at all revolutionary, but it leaves one with an annoying...
11
1992
by: codebloatation | last post by:
I know how to use references but i DO not get WHY they exist other than to add to the language. Are they actually needed for anything?
1
1422
by: kaosyeti | last post by:
is there an easy way to evaluate a calculated control step by step? i have a lot of long expressions in a lot of my controls and if there's an error, tracking it down is a PAIN. excel has a built-in function for evaluating formulas... does access? thanks. -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-access/200601/1
28
2040
by: Frederick Gotham | last post by:
When I was a beginner in C++, I struggled with the idea of references. Having learned how to use pointers first, I was hesitant to accept that references just "do their job" and that's it. Just recently, a poster posted looking for an explanation of references. I'll give my own understanding if it's worth anything. First of all, the C++ Standard is a very flexible thing. It gives a mountain of freedom to implementations to do things...
3
2117
by: DonJefe | last post by:
Does anyone have experience using project->project references in large solutions? What are the plus/minuses that you have found? Currently, we are using the binary assembly references for our code, but this becomes problematic when you want to build from multiple branches/working directories. Any thoughts on this would be appreciated. Thanks
15
3139
by: sara | last post by:
I am stuck. I have a report that I use in multiple places, so I call it with varying parameters (using the Where Clause in the code). I preview the report, send it to snap, then close the preview (the user can go to the server to see the snap view). Print, snap, then close is the only way I can snap with a Where clause. If there is No data that meets the criteria, I can cancel the print,
29
1517
by: Simon Saize | last post by:
Hi - What's the point of having references (&)? Why don't we just use pointers (*)? Thanks.
2
2608
by: Ken Camann | last post by:
Hey everyone. First of all let me say that I know that the C++ standard never makes any guarantees about compiler implementation and thus about the performance of any language feature. That said, r-value references are clearly being included because they make certain optimization analysis cases possible to identify, and every compiler will try to include them. Anyway, I've been playing around with some code in ConceptGCC using r-
0
9518
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10430
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10159
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2917
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.