Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

5922 Word was unable to open data source

156 views
Skip to first unread message

Lidia Fernandes

unread,
Nov 19, 2003, 7:57:36 AM11/19/03
to
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

unread,
Nov 19, 2003, 8:36:09 AM11/19/03
to
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

"Lidia Fernandes" <lid...@ci.ucp.pt> wrote in message
news:0b4001c3ae9c$b4addc10$a401...@phx.gbl...

0 new messages