5922 Word was unable to open data source

L

Lidia Fernandes

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
 
P

Peter Jamieson

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.
 

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