Home » Windows OS

Installing DAO 3.5 and 3.6

I have an application that makes use of various versions of an older COM dll.  Some version of the dll use DAO 3.5 to access a Microsoft Access database and some use DAO 3.6 do to the same.  So, my install needs to make sure that DAO 3.5 and 3.6 get installed on the target machine so I can be sure this older COM dll will function, regardless of which version they choose to use. 

That said, I used to use InstallShield to create installation programs.  Installshield has merge modules for just about everything, including DAO 3.5 and 3.6.  I am trying to create a setup project in VS 2008 that will do the same.  The problem is I cannot find out how to get DAO 3.5 and 3.6 to be included in my setup project. 

Any ideas on how to do this?  Thank you so much!



7 Answers Found


Answer 1

Hello Andy,


Have you tried the merge  module of VS setup  project? Here is a document talking about it.



I think it can implement the same function  as InstallShield.



Kira Qian

MSDN Subscriber Support in Forum

If you have any feedback on our support, please contact msdnmg@microsoft.com

Answer 2

Hi Kira.

Thanks for the reply.  This article talks about how to include a merge  module in a setup  project.  While this is useful, it isn't any help unless you have the merge module to include.

Installsheild comes with a pretty complete library of merge modules  to install  lots of different Microsoft (and other) technologies.  For example, to include DAO 3.5 and DAO 3.6, all you need to do is select those components from a list of re-distributable modules.  All of the details (including the exceptions for different operating systems) are encapsulated within the merge modules.  What I seem to be finding out is that unless you are using installsheild, you have to build your own merge modules which means figuring out all the details. 

This isn't fun when it comes to installing  the JET engine because of all the changes to MDAC made over the years.  It used to be you could just install MDAC and you'd get the Jet engine and all the ODBC drivers.  Now it is split into two, and I don't know what the JET engine is packaged with. 

Can you confirm that Microsoft does not have merge modules that can be included in a visual studio setup project  for its component technologies such as DAO?

Thanks again!



Answer 3

Hi Andy,


> Can you confirm that microsoft  does not have merge  modules that can be included in a visual studio setup  project for its component technologies such as DAO?


Yes, Microsoft doesn’t offer these components’ merge module which InstallShield has. DAO 3.5 and Jet 3.5 are available on this page.



You can also copy the one from InstallShield.



Kira Qian

MSDN Subscriber Support in Forum

If you have any feedback on our support, please contact msdnmg@microsoft.com

Answer 4

Thank you for the link.  It is a shame that Microsoft doesn't provide merge  modules for its own technologies. 

I cannot copy them from InstallShield, because they are not package separate .msm files.  installshield  packages the modules  they built into a library that can only be used by installshield.


Answer 5

Unfortunately, the merge  modules available at this link are very old so I don't trust them to do the right thing on newer operating system.  For example, the DAO 3.5 merge module was create  in 2000.  Seems risky to use it.

Answer 6


I'm facing the same issue.

Did you find another solution to replace installshield  merge modules?


Thank you.


Answer 7

I wouldn't be surprised if DAO 3.5 is 10 years old (if not older). It's probably safe to use...





I have a .NET version 1.1 project that has a reference to Interop.DAO.  My understanding is that this is a wrapper for an underlying version of a COM based DAO DLL i.e. dao360.dll or perhaps DAO350.dll.

I need to understand the specific version of DAO (3.5/3.6) from which this reference came from. i.e. which version of DAO is this wrapper.. wrapping.

Any way to tell?

Tried looking at the reference properties/assembly manifest/using .net reflector.  Seem unable to find this out.

Any help is greatly appreciated.


My table, "tblItemMaster" has a unique index "ItemDescription". It has
other keys, including an autonumber Primary Key. Table's been around
for awhile.

In vba, I open up rstItemMaster as a DAO recordset on the Item Master
as a dynaset. First, I check to see if my (excel-based) transaction
has a duplicate item description. If it does not, I decide whether to
Add or Update the new transaction base on the presence or absence of
other keys. In all cases, though, I rely on the fact that I've already
checked to see if there is an existing record in the table with that
descripiton (see code below):

The problem I'm having is that the initial
"rstItemMaster.FindFirst...." action is not finding a match, even
though there is absolutely a matching description already resident in
the table. As a result, when I go to update a different (but already
existing) record with this description, I get an error indicating I'm
trying to add a duplicate record.

I've copied and pasted the exact same criteria from the
rstItemMaster.FindFirst method to a "DLookup" in the immediate window
(to maintain the exact same context...), and the DLookup FINDS the
duplicate record. I will admit to struggling a little with the
preponderance of double quotes in my descriptions, but the fact that I
can copy and paste it exactly into the DLookup suggests the quotes
aren't the issue. (FYI, I'm also cursed with lots of descriptions
containing single quotes as well....)

Ideas? Resources?

Dim rstItemMaster As DAO.Recordset
    Set rstItemMaster = CurrentDb.OpenRecordset("tblItemMaster", dbOpenDynaset)

    With xlSh
        While lngConsecutiveBlankRows < 4
            If Len(RTrim(LTrim(.Cells(lngCurrentRowNbr, 5)))) = 0 Then   'ACC# in Column 5 (E) and must not be blank
                lngConsecutiveBlankRows = lngConsecutiveBlankRows + 1
                Debug.Print "Row " & lngCurrentRowNbr
                .Cells(lngCurrentRowNbr, PropQty) = 1
                .Cells(lngCurrentRowNbr, UnitColumn) = 1
                If IsNumeric(.Cells(lngCurrentRowNbr, ExtendedCostColumn)) Then
                    If Len(RTrim(LTrim(.Cells(lngCurrentRowNbr, 4)))) = 0 Then
                        .Cells(lngCurrentRowNbr, CommentColumn) = "Blank Descriptions not allowed -- rejected"
                        rstItemMaster.FindFirst "ItemDescription=""" & Replace(.Cells(lngCurrentRowNbr, 4), Quote, Quote & Quote) & Quote
                        If rstItemMaster.NoMatch Then
                            rstItemMaster.Filter = "ItemThirdPartyVendor=3"
                            rstItemMaster.FindFirst "ItemThirdPartyVendorPartNbr='" & .Cells(lngCurrentRowNbr, 5) & "'"
                            If rstItemMaster.NoMatch Then                           'Must be an Add
                                rstItemMaster!ItemDescription = .Cells(lngCurrentRowNbr, 4)
                                rstItemMaster!ItemUOM = .Cells(lngCurrentRowNbr, 3)
                                rstItemMaster!ItemEUOM = rstItemMaster!ItemUOM
                                rstItemMaster!ItemEUOMFactor = 1
                                rstItemMaster!ItemMaterialStdUnitCost = Round(.Cells(lngCurrentRowNbr, ExtendedCostColumn), 2)
                                rstItemMaster!ItemLaborStdUnitHours = 0
                                rstItemMaster!ItemVendor = .Cells(lngCurrentRowNbr, 9)
                                rstItemMaster!ItemVendorPartNbr = .Cells(lngCurrentRowNbr, 10)
                                rstItemMaster!ItemTab = "MCDean"
                                rstItemMaster!ItemThirdPartyVendor = 3
                                rstItemMaster! ItemThirdPartyVendorPartNbr = .Cells(lngCurrentRowNbr, 5)     'ACC#
                                rstItemMaster.Bookmark = rstItemMaster.LastModified
                                .Cells(lngCurrentRowNbr, CommentColumn) = "Added ID=" & rstItemMaster!ItemID

                                .Cells(lngCurrentRowNbr, CommentColumn) = "Updating ID=" & rstItemMaster!ItemID

                                rstItemMaster!ItemDescription = .Cells(lngCurrentRowNbr, 4)
                                rstItemMaster!ItemUOM = .Cells(lngCurrentRowNbr, 3)
                                rstItemMaster!ItemEUOM = rstItemMaster!ItemUOM
                                rstItemMaster!ItemEUOMFactor = 1
                                rstItemMaster!ItemMaterialStdUnitCost = Round(.Cells(lngCurrentRowNbr, ExtendedCostColumn), 2)
                                rstItemMaster!ItemLaborStdUnitHours = 0
                                rstItemMaster!ItemVendor = .Cells(lngCurrentRowNbr, 9)
                                rstItemMaster!ItemVendorPartNbr = .Cells(lngCurrentRowNbr, 10)
                                rstItemMaster!ItemTab = "MCDean"
                                rstItemMaster!ItemThirdPartyVendor = 3
                                rstItemMaster! ItemThirdPartyVendorPartNbr = .Cells(lngCurrentRowNbr, 5)     'ACC#
                                rstItemMaster.Bookmark = rstItemMaster.LastUpdated
                                .Cells(lngCurrentRowNbr, CommentColumn) = "Updating ID=" & rstItemMaster!ItemID
                            End If
                            If rstItemMaster!ItemThirdPartyVendor = 3 And rstItemMaster!ItemThirdPartyVendorPartNbr = .Cells(lngCurrentRowNbr, 5) Then
                                rstItemMaster!ItemDescription = .Cells(lngCurrentRowNbr, 4)
                                rstItemMaster!ItemUOM = .Cells(lngCurrentRowNbr, 3)
                                rstItemMaster!ItemEUOM = rstItemMaster!ItemUOM
                                rstItemMaster!ItemEUOMFactor = 1
                                rstItemMaster!ItemMaterialStdUnitCost = Round(.Cells(lngCurrentRowNbr, ExtendedCostColumn), 2)
                                rstItemMaster!ItemLaborStdUnitHours = 0
                                rstItemMaster!ItemVendor = .Cells(lngCurrentRowNbr, 9)
                                rstItemMaster!ItemVendorPartNbr = .Cells(lngCurrentRowNbr, 10)
                                rstItemMaster!ItemTab = "MCDean"
                                rstItemMaster!ItemThirdPartyVendor = 3
                                rstItemMaster! ItemThirdPartyVendorPartNbr = .Cells(lngCurrentRowNbr, 5)     'ACC#
                                .Cells(lngCurrentRowNbr, CommentColumn) = "Updating Item ID=" & rstItemMaster!ItemID
                                .Cells(lngCurrentRowNbr, CommentColumn) = _
                                    "This Item Description is not unique. Same desc as ID=" & _
                                    rstItemMaster!ItemID & "ACC#=" & tItemMaster!ItemThirdPartyVendorPartNbr & " -- Rejected"
                            End If
                        End If
                    End If
                    .Cells(lngCurrentRowNbr, CommentColumn) = "Invalid Extended Cost Column -- Rejected"
                End If
            End If
            .Cells(lngCurrentRowNbr, PropQty).ClearContents
            .Cells(lngCurrentRowNbr, UnitColumn).ClearContents
            lngCurrentRowNbr = lngCurrentRowNbr + 1
            rstItemMaster.Filter = ""
    End With

************** End Code ****************


In VBA code, I'm having problems inserting reocrds into a table with fields from another table, It is a parent-table, child-table, grandchild-table relationship. I've arleady completed my parent-table insert without any problems, nowI'm attempting to insert into the child-table and failing with a 3022 error.

My parent-table design is as follows:

PT_ID                           automuber

PT_User_Name              text

My Child_Table design is as follows:

CT_ID                         autonumber

FK_PT                         number

CT_Text                      text

CT_DATE                    date

I created my entry in the PT as follows:

Dim db As DAO.Database
Set db = CurrentDb
Dim rs  As DAO.Recordset

Set rs = db.OpenRecordset("PT", dbOpenDynaset)
Dim strCriteria As String

strCriteria = "[user_PT] ="" & [Form_frm_PT]![tb_USERID] & """

With rs '
    .FindFirst (strCriteria)

If IsNull(user_UserID) Then
        !PT_User_Name = Form_frm_PT!tb_USERID

        tb_ID_for_new_PT = .LastModified
        tb_ID_for_new_PT = rs!PT_ID     <= it took this option because the user already existed in the parent_table

        End If
      Form_frm_PT!tb_ID_for_new_PT = tb_ID_for_new_PT
    End With

    Set rs = Nothing
  End Sub

It's OK to here!

Now I attempt to insert the first child and it fails.

Private Sub Add_new_child()
' insert child

Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim rs_child As DAO.Recordset
Dim str_SQL As Variant

' Set the current database
Set db = CurrentDb

Set rs_child= db.OpenRecordset("child", dbOpenDynaset)
Dim strCriteria As String

    With rs_child '

        !CT_Text = [Form_frm_child]![tb_child_text]
        !FK_PT= [Form_frm_child]![tb_ID_for_child]     <= causes the error!!!!!
        !CT_DATE = [Form_frm_date]![tb_date]

        Form_frm_child!tb_CT_ID = .LastModified
    End With
    Set rs_child = Nothing

If I leave in the reference of the foreign key to the parent it fails, if I comment out the foreign key, it works but with the reference completed to the parent table?

What am I missing?




Hi -

I need to run an update query on a linked table as part of a procedure in VBA, and I need to run it directly on the DB2 host (without using Access' query engine) to keep the data in the correct format (basically, I'm having to add milliseconds into a timestamp field).  I tried the following code using dbExecDirect, but since we're using Access 2007, that doesn't work.  Unfortunately I'm not familiar with ADO so I don't know how to rewrite this routine, but I'm guessing that's how I need to fix it. 

The query referenced in the code below (qryHighValue) is a pass-through query that's basically just a placeholder - I already learned the hard way that pass-throughs can't do updates.

Help? Pretty please? I've lost days of work and gained many grey hairs to this!

  Dim Q As DAO.QueryDef
  Dim db As DAO.Database
  Dim highTest As Date
  Dim parentID As String
  Dim sqlString As String
  Dim cnnect As String

  highTest = Me.END_TSTMP
  parentID = Me.CMPGN_ID

  cnnect = "ODBC;DSN=aaaaa;UID=xxx;PWD=xxxx"
  cnnect = cnnect + ";MODE=SHARE;DBALIAS=aaaaa;DISABLEUNICODE=1;"
  sqlString = "UPDATE MY_TABLE SET END_TSTMP = '9999-12-31-' "
  sqlString = sqlString + "WHERE (((CMPGN_ID)=" + parentID + "));"

  If highTest > #12/1/5000# Then

    Set db = CurrentDb()
    Set Q = db.QueryDefs("qryHighValue")
    Q.Connect = cnnect
    Q.SQL = sqlString
    db.Execute sqlString, dbExecDirect

  End If



Hi all,

I have to write new application in access2003 and I am new in access. I edited access application before and this is first time I have to create one.

I really don't know Which method I Should choose for my application ADO or DAO.

The application only has 7 tables and I have to make data entery form fro this application as well. Please guid me what is the best way to do this.

Is there any way I make user to use my command button for inserting and Uodating and deleteing data instead of using the keys at the form.(|<   , <  ,>, >|, etc)

Please Please Help me.


I've been struggling to convert the following code to ADO.  Can anyone help?

'//Name     :   DSNlessLink
'//Purpose  :   Create a linked table to SQL Server without using a DSN
'//     stLocalTableName: Name of the table that you are creating in the current database
'//     stRemoteTableName: Name of the table that you are linking to on the SQL Server database
'//     stServer: Name of the SQL Server that you are linking to
'//     stDatabase: Name of the SQL Server database that you are linking to
'//     stUsername: Name of the SQL Server user who can connect to SQL Server, leave blank to use a Trusted Connection
'//     stPassword: SQL Server user password

Public Function dao_DSNlessLink(stLocalTableName As String, stRemoteTableName As String, stServer As String, stDatabase As String, Optional stUsername As String, Optional stPassword As String)
    On Error GoTo DSNlessLink_Err
    Dim td As TableDef
    Dim cursortype As CursorTypeEnum
    Dim stConnect As String

    For Each td In CurrentDb.TableDefs
        If td.Name = stLocalTableName Then
            CurrentDb.TableDefs.Delete stLocalTableName
        End If

    If Len(stUsername) = 0 Then
        '//Use trusted authentication if stUsername is not supplied.
        stConnect = "ODBC;DRIVER=SQL Server;SERVER=" & stServer & ";DATABASE=" & stDatabase & ";Trusted_Connection=Yes"
        '//WARNING: This will save the username and the password with the linked table information.
        stConnect = "ODBC;DRIVER=SQL Server;SERVER=" & stServer & ";DATABASE=" & stDatabase & ";UID=" & stUsername & ";PWD=" & stPassword
    End If
    Set td = CurrentDb.CreateTableDef(stLocalTableName, dbAttachSavePWD, stRemoteTableName, stConnect)
    CurrentDb.TableDefs.Append td
    DSNlessLink = True
    Exit Function


    If Err.Number = 3027 Then
        Resume Next
        DSNlessLink = False
        MsgBox "DSNlessLink encountered an unexpected error: (" & Err.Number & ")" & Err.Description
    End If
End Function


I am running ona 32 bit machine and I have updated in the registry 

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\12.0\Access Connectivity Engine\Engines\MaxLocksPerFile  to equal 000186a0 (100000)


In addition I have written in my program the following DAODBEngine_definst.SetOption(dao.SetOptionEnum.dbMaxLocksPerFile, 100000)


However I cannot go above 9500 Records because I get a MaxLocksPerFile ERROR




Along time ago, I use code similar to this to insert a record and to retrieve the primary key of the newly create record. However, its coming back Null. I am now using SQL Server, do I have to use ADO to inser the record? I need the value of the primary key returned which is why I'm not using a INSERT statement.   

    Dim db As DAO.Database
    Dim rs As DAO.Recordset
    Set db = CurrentDb
    Set rs = db.OpenRecordset("tblTrailerUtilizationDetails", dbOpenDynaset, dbSeeChanges)
    With rs
        .Fields("lngTrailerActivityHeaderId") = lngTrailerActivityHeaderId
        .Fields("txtShowNumber") = txtShowNumber
        .Fields("lngTrailerLoadTypeId") = lngTrailerLoadTypeId
        createChildRecord = .Fields("lngTrailerUtilizationDetailsId")
    End With
    Set rs = Nothing
    Set db = Nothing


   I have installed Office 2010 64 bit on our Windows Server 2008 for migrating a 2007 32 bit Access Project (.adp). I cannot seem to find the reference for the Microsoft DAO 3.6 Object Library. Any thoughts of why this has not installed on the first place?



Hello all, I am trying to put together a simple POC for a n-layer application using EF4 in the data tier.  I have looked at numerous examples on the web and it seems to be a common practice to use a DAO or a Repository as the wrapper to an ORM.  My understanding that the main difference between the two is that a Repository is more generic and takes IQueryable for example for parameters.  I would like (for better of for worse) at this point to stick with simpler DAO objects that will contain fairly specific methods such as GetPersonByFirstName(string name), similarly to what has been done before with ADO.NET based stuff.  That said, I still need several "cross-cutting" features for my DAOs.

1. How do I go about sharing the context between DAOs?  Preferably this would be in a way where the business object instantiating the DAO wouldn't have knowledge of EF.  Initially I was thinking that the BO will be passing the session along to the DAOs but that will violate my requirement of the BO being independent of EF (unless I am not thinking of something).  Maybe some sort of Singleton/Factory approach?
2. Is there a more elegant way to handle this for ASP.NET applications using the request context?  Basically a session-per-request type setup, but without having to modify any of the presentation tier code.
3. I imagine I might have a base class DAO with very basic CRUD methods that will be shared across all DAOs, but again not to the point of IQueryable.
4. I would like to use TransactionScope within my business object to wrap my DAO (I don't see this being an issue).

Thank you!



I have the following Access 2003 DAO code which uses a query with no criteria (filtering) to open a recordset, but then attempts to add an "after the fact" filter and then requery.

    Set recIn = db.OpenRecordset("qryCombinedExplosionsFcstSelect")

    recIn.Filter = "[qryCombinedExplosionsFcstSelect]!BodyCode" & _

        " " & strMultipleSelectFilter


The above code doesn't filter, and I'm not sure why.  The Value of the filter after I set it is as follows as shown from the immediate panel:
? recIn.Filter
[qryCombinedExplosionsFcstSelect]!BodyCode IN ("BADM","NG")

Any ideas?
Rich Locus, Logicwurks, LLC


   I have an access 12 (2007) application (adp). I have modified its code to eliminate the use of DAO 3.6 Object library. I have then removed the reference to DAO 3.6. The project compiles fine and I can create an (ade) from the new project. However, when I try to edit a module, and specifically when intellisense is trying to load the data type, Access Crashes. for example I type:

Dim strStringCriteria as {as soon as i hit the space bar} access crashes.

if i copy and paste the line "Dim strStringCriteria as String" from NotePad, the program runs and compiles fine.

Any idea of what may be causing this behavior?




Hello all Members,

I am new to microsoft platform.

In my application, Can i Write all query related stuff in Separate DAO class ?

Can I make Separate DAO class for each table in Database ?

Where i should place this classes in directory structure of my application ?

Can I write one separate method for a each query that i fired in my program?

Can you tell me In this way, professional development occur?

Please guide me in this & give your expert suggestions.

Thanks in advance.


I'm posting here since the answer to another user's query to "Where's the appropriate forum" who was having a problem with ADO was directed to post here. If there really is an ADO/DAO forum somewhere - please point me to it.

I am desperate to be able to utilize an Access 2007 database from C/C++ and trying now, unsuccessfully, for two days have decided to produce an app that demonstrates my problem.

I am 99% sure I do not have a '.dll mismatch - I see the appropriate ones load, I have no references to any library in my VS project(s), never do. The database is reduced to one autoincrement ID field and one character field, FMS

Here is a demonstration of the problem - this is the entire source code of a small console application.

Symptom: Type mismatch error on pNewRecord -> Update(vtMissing,vtMissing);

Entire program:


#include <windows.h>

#import <C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE14\\ACEDAO.dll> rename( "EOF", "AdoNSEOF" )

   extern "C" int main(int argc,char *argv[]) {

   DAO::_DBEngine *pEngine;


   try {

   HRESULT hr = CoCreateInstance(__uuidof(DAO::DBEngine),NULL,CLSCTX_ALL,IID_IDispatch,(LPVOID*)&pEngine);

   DAO::DatabasePtr pDatabasePtr = pEngine -> OpenDatabase(L"D:\\TEMP\\cvDocuments.accdb");

   pDatabasePtr -> Execute(L"INSERT INTO Documents(Created) VALUES(time())", _variant_t(DAO::dbFailOnError));

   DAO::RecordsetPtr pNewRecord = pDatabasePtr -> OpenRecordset(L"SELECT FMS FROM Documents WHERE ID = (SELECT MAX(ID) FROM Documents)");

   pNewRecord -> MoveFirst();

   pNewRecord -> Edit();

   pNewRecord -> GetFields()-> Item["FMS"] -> Value = L"FMS";

   pNewRecord -> Update(vtMissing,vtMissing);

   } catch ( _com_error e ) {

      IErrorInfo *pIErrorInfo = e.ErrorInfo();
      BSTR fms;
      pIErrorInfo -> GetDescription(&fms);


   return 0;






I have developed an MSAccess application in DAO VBA where a front-end form is updated, updates a field in a linked table on the Server back-end database,  and immediately displays an appointment status on a display form.  All other users always have the same display form open on their front-end databases showing all current-date appointments.

When a user changes a status, say to Confirmed from Held, I would like that result to be immediately displayed on all user forms.  I have successfully used a timer to accomplish this, but wanted to get away from the refresh blinking and slowing down data entry.  

I changed to a Refresh command button that works well, but requires user interaction to keep up with the action.

With my updating code on the front-end form, and the resulting update of the field in the table of the back-end database, I would like the back-end to automatically refresh all front-end user forms based on the fact that it has been updated.   

Thanks for any ideas!



We use DAO 3.5 and we are seeing delays on some queries on windows machines 7.
The database is on a windows server 2008.
The query is a join between two tables and contains an ORDER BY.

The query execution is very slow.
If we remove the join or order by the query execution is fast.

Is there an incompatibility between Windows 7 and DAO 3.5 ?

Thank you for your ideas and suggestions



Microsoft has indicated that the MFC DAO classes via <Afxdao.h> have been deprecated as of Access 2007.  These classes served as a convenient interface to dao360.dll.  As the ACE engine supports direct DAO access via native C/C++, will Microsoft eventually be providing MFC DAO classes to interface to acedao.dll?  If so, will they essentially replicate the current MFC DAO classes?


Como puedo abrir una base de datos usando codigo atravez de dao 3.6

en visual basic 6 lo hacia con declarar una variable como base de datos por ejemplo: Private Db as Database

Como la declaro en la version 10?


Using Microsoft Access 2010 x64 against Sql Server 2008 R2 x64, and using a DSN with the Sql Native Driver driver, the RecordsAffected property of a querydef returns the recordsAffected of the last Microsoft Access action query that was run by vba, not the records affected of the current query (the one running an Sql Server sproc).  Here's the code:      

      Dim SqlPassThrough As String
      Dim qdf As DAO.QueryDef
      Dim dbs As DAO.Database
      Set dbs=currentdb()

        Set qdf = dbs.CreateQueryDef(vbNullString)
        SqlPassThrough = "EXEC dbo.MyStoredProcFoo;"
        qdf.Connect = "MyConnectionStringFoo"
        qdf.ReturnsRecords = False
        qdf.SQL = SqlPassThrough
        qdf.Execute dbFailOnError  'I also tried without dbFailOnError
        SqlExecute = qdf.RecordsAffected  'This returns the number for the LAST LOCAL (Jet) query run, not the current (pass thru).
        Set qdf = Nothing


I have upgraded my database from Access 2003 to Access 2007.  I have a form that allows an admin user to assign permissions on the database objects (tables, macros, queries, forms, reports) to a specfic user group by checking the permissions.  For example I, as the admin, can go to this form select the usergroup cte and then select table1 and check read/design, modify/design and delete data permissions and click OK.  However when I use this form in Access 2007 it does not save my changes.  When I load it back up the permissions revert back to their originial state.  So upon looking through the code I have found the following;

    If IsMissing(varObjName) Then
        If intAction = adhcPermissionAdd Then
            cnt.Permissions = cnt.Permissions Or lngPerm
        ElseIf intAction = adhcPermissionSubtract Then
            cnt.Permissions = cnt.Permissions And Not lngPerm
            cnt.Permissions = lngPerm
        End If
        If intAction = adhcPermissionAdd Then
            doc.Permissions = doc.Permissions Or lngPerm
        ElseIf intAction = adhcPermissionSubtract Then
            doc.Permissions = doc.Permissions And Not lngPerm
            doc.Permissions = lngPerm
        End If
    End If

I also found this website (http://msdn.microsoft.com/en-us/library/bb243755(v=office.12).aspx) when researching DAO.Document permissions which states that the permissions property is now 'hidden" in access 2007.

So my question is should the above code work in Access 2007 if the permissions property is now hidden?  Or is their some other way that I need to set the Permissions property on the DAO.Document object

I hope someone can answer me here.  I originally posted to a Visual Basic forum and they kicked me out.  Hehe.

Thanks in advance for any advice or help you can give.





<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure