Help!! - Access and Word

F

funwontan

--------------------------------------------------------------------------------

Hello guys!! Am new, so i don't know if this question has bin asked b4
Since i can't find the search button on the website, pardon me if i a
asking an old question.

I am in access 2003. I am tryin to use the code below to open
microsoft word document and insert the data in the access query int
the word document. i keep getting this error :

"This data source contains no visible tables"

the only table that exist in the access program is a "linked table". S
i dont kno if thats the problem. But then, the code below used to work
So i just recently started getting this error. Can anyone direct me o
how to fix this problem??? Thanks for ur time.




.************** CODE STARTS ************************


Dim one As Word.Application
Set one = Nothing
Set one = CreateObject("Word.Application")




Dim datasourceerror As Integer
datasourceerror = 5 'bogus value

one.Documents.Add Template:="Normal", NewTemplate:=False
DocumentType:=0


one.Selection.Range.insertDatabase Format:=0, Style:=0
LinkToSource:=False, _
Connection:= _
"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Dat
Source=sourceD;Mode=Read;Extended Properties="""";Jet OLEDB:Syste
database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Databas
Password="""";Jet OLEDB:Engine Type=5;Jet OLEDB" _
, SQLStatement:= _
"SELECT `TrackingNo`, `name`, `Div`, `Date`, `Status`, `Contact` FRO
`assignment Query` ORDER BY `DateDue`" _
& "", PasswordDocument:="", PasswordTemplate:="", WritePasswordDocumen
_
:="", WritePasswordTemplate:="", DataSource:= _
sourceD, From:=-1, To:=-1, IncludeFields:=True

.************** CODE Ends ***********************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top