• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 520
  • Last Modified:

How to read data from a access database?

How can I work with an access database from Microsoft Excel's vba?

I've tried the following code, but I'm receiving Run-time error '3706' (on the third line)
(Microsoft Office 2007)

thanks for any kind of help.

Dim dbs As DAO.Database
    Dim rst As DAO.Recordset
    
    Set dbs = OpenDatabase("Y:\Receiption\Orders.accdb")
    Set rst = dbs.OpenRecordset("tblOrders")
 
    with rst
          .moveFirst
          ............
          'some code here
          ............
    end with

Open in new window

0
MnInShdw
Asked:
MnInShdw
  • 5
  • 5
5 Solutions
 
Saurabh Singh TeotiaCommented:
Have a look over this...this would help you over your problem...
http://www.codebase.com/support/kb/?article=C01014
Saurabh...
0
 
MnInShdwAuthor Commented:
thanks for your help.

I searched the whole C drive for c4dll.dll - c5oledb.dll - c5oleErrLkp.dll
nothing was found.

Any further help is much appreciated.
0
 
Saurabh Singh TeotiaCommented:
That might be the problem..because if the dll which is c5oledb.dll and c5oleErrLkp.dll is missing then you need to either load them and register it..to make it work...
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
MnInShdwAuthor Commented:
How can I load or register these dlls?

copying them from Office 2007's DVD? or any place to download them?


thanks
0
 
Saurabh Singh TeotiaCommented:
I believe  go and copy it from office 2007 dvd as im unable to find it over the internet...just install the full version of acess and excel..and i think it would be moved over automatically...
0
 
MnInShdwAuthor Commented:
I searched the DVD for the mentioned dlls, but nothing was found.
I uninstalled and reinstalled office, still the same problem .

I also searched for the same dlls in my PC at home that comes with
a pre-installed Office Enterprise 2007, but I failed to find the mentioned dlls.


any kind of further advice is much appreciated.

0
 
Saurabh Singh TeotiaCommented:
Thats weird...im not sure about any other reasons because of which this is happening...
0
 
MnInShdwAuthor Commented:
where these dlls are supposed to be located at?
0
 
Saurabh Singh TeotiaCommented:
These dlls suppose to come with full installation..did you re-install access as well..??
0
 
MnInShdwAuthor Commented:
yes. I did. I'm trying it once more just now.
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now