Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / November 2003

Tip: Looking for answers? Try searching our database.

5922 Word was unable to open data source

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lidia Fernandes - 19 Nov 2003 12:57 GMT
Hi

I am getting error Code = 5922 "Word was unable to open
the datasource" when running mail merge using MS-Word 2000
in some PC's. In another PC's it all works great.

I am getting information from the SQL Server (by OBDC) in
my VBA code. Here is code where I am getting error on
OpenDataSource method.

Thanks in advance for any help.
Lidia

'...
With ActiveDocument.MailMerge
   .MainDocumentType = wdFormLetters
   constr = "DSN=bddata;UID=lgWord;PWD=1234;
   sqlstr = " mp_docword " & NAluno & ",'" &
LCursos.Column(4, Me.LCursos.ListIndex) & "', '" &
Global_Identificacao & "', " & LCursos.Column(1,
Me.LCursos.ListIndex) & ", '" & LCursos.Value & "' , '" &
LCursos.Column(2, Me.LCursos.ListIndex) & "', '1','GET' "
   
   .OpenDataSource Name:="", _
       Connection:=constr, _
       SQLStatement:=sqlstr,  _
       LinkToSource:=False
       
End With
Peter Jamieson - 19 Nov 2003 13:36 GMT
Possibilities:
a. (the obvious one) does every PC have the DSN "bddata", and is it
configured the same way everywhere (especially the SQL Server network
library)
b. does your SQL Server use both Integrated Security and SQL's own security
scheme? Are the systems you are testing logged into a domain? If so, the
connection will probably be made using the domain logins and will probably
succeed or fail depending on the permissions of each login. If you want to
ensure that Integrated Security is /not/ used, include Trusted_Connection=No
in your connection string. Even if you thought Trusted_Connection was set to
No in the DSN, it isn't.

--
Peter Jamieson - Word MVP

> Hi
>
[quoted text clipped - 25 lines]
>
> End With
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.