Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interesting Dilemna with ADO/DAO SQLserver/ACCESS

Status
Not open for further replies.

cyberbiker

Programmer
Mar 16, 2001
431
US
Even for me this is a very strange problem.

I am converting an application to use a SQL server backend
But the application could also use an ACCESS backend. I am connecting using ADO, but I "need to be able to connect DAO also". (not quite certain why, I must admit)

The code must be identical with the exception of a class I have written to handle the differences using a conditional compile within the class and referencing either DAO 3.51 or
ADO 2.6 as appropriate.

Believe it or not, I actually have this working very well with one major glitch.

I need to be able to compact the ACCESS database through code.

I can compact the ACCESS database when connected DAO, I can shrink the SQL server Database when connected ADO or DAO fine. But I cannot seem to compact the ACCESS database when I do not have DAO 3.51 referenced.
I cannot add that reference since that would mean that I would no longer be able to use identical code in my app for both DAO and ADO.

My only solution is a seperate exe called from within the app to handle this, but I am hoping some one has a better idea. Terry (cyberbiker)
 
Check out the JRO Objects - Its a companion object to ADO, that provide compaction capability without the need for DAO

Add a reference to the Jet Replication Objects to the project.

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
Thanks Cajun. I will add that to my program Tuesday when I get to the asylum :) Terry (cyberbiker)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top