-
ADOX Problems
I have written a quick and dirty function (see below) that verifies whether a given table exists or not. (the function is used by another very important procedure).
Good, this function works really fine on my home computer with Access 2002.
Now when I try to run the database on the computer at work (MS Access 2002 as well) a message pops up asking me to uncheck the reference to ADO Ext. Ver 2.7., because the library doesn´t seem to exist, although a simple search indicates that the file msadox.dll is there in the correct location.
How do I reference it though? I have tried to gently guide Access to the file msadox.dll several times, but it hasn´t worked...
Thanks in advance for hints and suggestions.
Function tabvorh(tabname As String) As Boolean
Dim cat As New ADOX.Catalog
Dim tbl As ADOX.Table
Set cat.ActiveConnection = CurrentProject.Connection
tabvorh = False
For Each tbl In cat.Tables
If tbl.name = tabname Then
tabvorh = True
Exit For
End If
Next
Set cat = Nothing
End Function
-
Problem solved!
Hi all
I have just found the solution - apparently the Access version at work has only Ado Extension 2.5. so I had to uncheck everything and reselect Ado Ext. 2.5.
Sorry for asking you guys rightaway, I just thought that was going to be another of those unsolvable Access mysteries that keep haunting me...
-
The referenced file name is always the same, just the version changes. You can probably refer to ADOX 2.5 and ADODB 2.5 on the 2000 system in your modules. I have not finessed a way yet to switch on the fly depending on the installed MDAC, but it's easy enough of a fix.
Open the database on the system with Office 2000.
Go to Tools, References in any module
Uncheck:
Microsoft ActiveX Data Objects 2.7 Library
Uncheck:
Microsoft ADO 2.x for DDL & Security
For sanity purposes, click OK
Go back into Tools, References, and hopefully nothing appears checked that says ADO or Data Objects.
Still looking at Tools, References:
Find and select:
Microsoft ActiveX Data Objects 2.5 Library (or 2.1 library, if 2.5 is not available).
Find and select:
Microsoft ADO 2.5 for DDL & Security
Click OK.
Select Debug, Compile.
Close the database. Open it again and try to run your code.
If Access 2000 didn't scream at you when you tried to compile, more than likely it'll run.
If not, run off to Microsoft and update the MDAC on the 2000 system. Read the "white paper" discussions thoroughly, since Jet 4.0 no longer ships with MDAC 2.6 and higher. After 2.5, the base installation (2.1, 2.5) never visibly increments the version number in Tools, References when selecting, but if you grab the actual file that Tools, References points to, you'll see if you drop into Windows and look at the properties of the file, that it reflects the latest MDAC installed on that computer. Versions are listed on the white papers.
--------------------
As a side note:
When referring to ADODB and ADOX objects in code, especially during declaration, fully qualify the objects. In other words, instead of :
dim rst as recordset
do this:
dim rst as adodb.recordset
That way you're not accidentally mixing DAO with ADO.
-
Yes, in the 3 minutes it took to post my answer, you found the answer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|