UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Extracting Data From Access 2010 To Word 2003, Office 2003    
 
   
alysolyman1971
post Feb 19 2017, 03:38 PM
Post#1



Posts: 28
Joined: 2-February 14



Good day!

I was using the following code to extract data from access mdb to word 2003:


Dim db As Database
Dim rst As Recordset


Set db = OpenDatabase(MYDb)
Set rst = db.OpenRecordset("table1")


rst.Index = "index1"
rst.Seek "=", "variable"

Now, I upgraded access to 2010 (ACCDB) but my code is not working and giving me the following error message:

Unrecognized database format.


What to do please?
Go to the top of the page
 
Larry Larsen
post Feb 19 2017, 07:00 PM
Post#2


UA Editor + Utterly Certified
Posts: 24,390
Joined: 26-August 02
From: Melton Mowbray,Leicestershire (U.K)


Hi

It may may be worth a try changing this:
CODE
Dim db As Database
Dim rst As Recordset


to this:
CODE
Dim db As DAO.Database
Dim rst As DAO.Recordset


HTH's
thumbup.gif
Go to the top of the page
 
ScottGem
post Feb 19 2017, 07:15 PM
Post#3


UtterAccess VIP / UA Clown
Posts: 32,217
Joined: 21-January 04
From: LI, NY


Where are you running this code from?
Go to the top of the page
 
alysolyman1971
post Feb 20 2017, 06:15 AM
Post#4



Posts: 28
Joined: 2-February 14



I am running the code from word (VBA). word version is 2003
Go to the top of the page
 
ScottGem
post Feb 20 2017, 07:44 AM
Post#5


UtterAccess VIP / UA Clown
Posts: 32,217
Joined: 21-January 04
From: LI, NY


There is your problem Word 2003 doesn't understand the accdb format. Why would you think it would?

You need to save your Access file as a 2002-2003 mdb for your code to work.
Go to the top of the page
 
alysolyman1971
post Feb 21 2017, 09:48 AM
Post#6



Posts: 28
Joined: 2-February 14



2010 Access has got (web browser control) which is so good for me.

If I convert the file to (2003 - 2007) format. the control will not function.
Go to the top of the page
 
ScottGem
post Feb 21 2017, 01:14 PM
Post#7


UtterAccess VIP / UA Clown
Posts: 32,217
Joined: 21-January 04
From: LI, NY


Then you need to upgrade your version of Word.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    12th December 2019 - 11:48 PM