Reply
 
Thread Tools Display Modes
  #1   Report Post  
Sandra Miller
 
Posts: n/a
Default Open DataSource Works On Windows XP but not on Windows 2000

I am using VB.Net to automate Word 2003 mailmerge; the datasource is a
Microsoft Access database that has a database password. The code works fine
on my development computer which has Windows XP Professional (SP2 is not
installed) but it does not work on my deployment computer which has Windows
2000, SP4 installed. Both computers have Word 2003 installed. I thought it
might be a password problem but I removed the password and am still getting
the same error: "Word was unable to open the datasource."

Any help that you can provide would be greatly appreciated.

Thanks,
Sandy


  #2   Report Post  
Peter Jamieson
 
Posts: n/a
Default

Do you have exactly the same version of Word on both machines? (as in Word
Help|About)

Can you post the details (i.e. the code, and the details of what each
parameter actually contains when the statement is executed) of your
OpenDataSource statement here please?

Is the database in the same folder in each case? Is it on the local machine,
or on a network path? Could there be a security/permissions issue?

Peter Jamieson
"Sandra Miller" wrote in message
ink.net...
I am using VB.Net to automate Word 2003 mailmerge; the datasource is a
Microsoft Access database that has a database password. The code works fine
on my development computer which has Windows XP Professional (SP2 is not
installed) but it does not work on my deployment computer which has Windows
2000, SP4 installed. Both computers have Word 2003 installed. I thought it
might be a password problem but I removed the password and am still getting
the same error: "Word was unable to open the datasource."

Any help that you can provide would be greatly appreciated.

Thanks,
Sandy



  #3   Report Post  
Sandy
 
Posts: n/a
Default

Peter:

Thanks for your suggestions. I finally figured it solved my problem although
why the same code did not work on both machines is still a mystery to me.
Both machines have the same version of Word, i.e., the same build. Both
machines use the same Access database, located in the same local directory so
network and security don't seem to be the issue.

Originally the database was not password protected so I was using the
following code with no problems:

..OpenDataSource(Name:=mstrDataSourceName, LinkToSource:=True,
AddToRecentFiles:=False, SQLStatement:=mstrDataSourceSQL.ToString,
SQLStatement1:=mstrDataSourceSQL1.ToString)

When I added a database password, I change the code to the following:

..OpenDataSource(Connection:=strCnn.ToString, Name:=mstrDataSourceName,
LinkToSource:=True, AddToRecentFiles:=False,
SQLStatement:=mstrDataSourceSQL.ToString,
SQLStatement1:=mstrDataSourceSQL1.ToString,
SubType:=Word.WdMergeSubType.wdMergeSubTypeWord200 0)

whe

strDSN = "DSN=" & IO.Path.GetFileNameWithoutExtension(mclsAsset.IMDb )
strDBQ = ";DBQ=" & IO.Path.Combine(mclsAsset.Directory, mclsAsset.IMDb)
strPWD = ";PWD=" & mclsAsset.PWord
strCnn = strDSN & strDBQ & strPWD & ";FIL=MS Access"

This worked fine on my Windows XP computer but not my Windows 2000. After
much trial & error I came up with a strCnn that now works on both machines:

strDSN = "DSN=MS Access Database"
strDBQ = ";DBQ=" & IO.Path.Combine(mclsAsset.Directory, mclsAsset.IMDb)
strPWD = ";PWD=" & mclsAsset.PWord
strDbPWD = ";Database Password=" & mclsAsset.PWord
strCnn = strDSN & strDBQ & strDbPWD & strPWD & ";FIL=MS Access"

Since I had little success finding documentation on what connection string
to use when the Access database has a database password, I thought I'd pass
along my results. It would be nice to know why a connection string that works
on Windows XP doesn't work on Windows 2000.

Sandy





"Peter Jamieson" wrote:

Do you have exactly the same version of Word on both machines? (as in Word
Help|About)

Can you post the details (i.e. the code, and the details of what each
parameter actually contains when the statement is executed) of your
OpenDataSource statement here please?

Is the database in the same folder in each case? Is it on the local machine,
or on a network path? Could there be a security/permissions issue?

Peter Jamieson
"Sandra Miller" wrote in message
ink.net...
I am using VB.Net to automate Word 2003 mailmerge; the datasource is a
Microsoft Access database that has a database password. The code works fine
on my development computer which has Windows XP Professional (SP2 is not
installed) but it does not work on my deployment computer which has Windows
2000, SP4 installed. Both computers have Word 2003 installed. I thought it
might be a password problem but I removed the password and am still getting
the same error: "Word was unable to open the datasource."

Any help that you can provide would be greatly appreciated.

Thanks,
Sandy




  #4   Report Post  
Peter Jamieson
 
Posts: n/a
Default

The only thing(s) that make sense to me are that either
a. you have a DSN matching "DSN=" &
IO.Path.GetFileNameWithoutExtension(mclsAsset.IMDb ) (in essence) on your
WinXP box but not on your Win2K box. Typically when you install Office it
creates a number of standard ODBC DSN's, but maybe someone created one with
the same name as the Access database you are using or
b. the DSN constructed using "DSN=" &
IO.Path.GetFileNameWithoutExtension(mclsAsset.IMDb ) does not exist. but for
some reason the WinXP box behaves differently (could have a different
version of MDAC, ODBC or Jet?). However, I would be surprised if that was
the case.

Peter Jamieson
"Sandy" wrote in message
...
Peter:

Thanks for your suggestions. I finally figured it solved my problem
although
why the same code did not work on both machines is still a mystery to me.
Both machines have the same version of Word, i.e., the same build. Both
machines use the same Access database, located in the same local directory
so
network and security don't seem to be the issue.

Originally the database was not password protected so I was using the
following code with no problems:

.OpenDataSource(Name:=mstrDataSourceName, LinkToSource:=True,
AddToRecentFiles:=False, SQLStatement:=mstrDataSourceSQL.ToString,
SQLStatement1:=mstrDataSourceSQL1.ToString)

When I added a database password, I change the code to the following:

.OpenDataSource(Connection:=strCnn.ToString, Name:=mstrDataSourceName,
LinkToSource:=True, AddToRecentFiles:=False,
SQLStatement:=mstrDataSourceSQL.ToString,
SQLStatement1:=mstrDataSourceSQL1.ToString,
SubType:=Word.WdMergeSubType.wdMergeSubTypeWord200 0)

whe

strDSN = "DSN=" & IO.Path.GetFileNameWithoutExtension(mclsAsset.IMDb )
strDBQ = ";DBQ=" & IO.Path.Combine(mclsAsset.Directory, mclsAsset.IMDb)
strPWD = ";PWD=" & mclsAsset.PWord
strCnn = strDSN & strDBQ & strPWD & ";FIL=MS Access"

This worked fine on my Windows XP computer but not my Windows 2000. After
much trial & error I came up with a strCnn that now works on both
machines:

strDSN = "DSN=MS Access Database"
strDBQ = ";DBQ=" & IO.Path.Combine(mclsAsset.Directory, mclsAsset.IMDb)
strPWD = ";PWD=" & mclsAsset.PWord
strDbPWD = ";Database Password=" & mclsAsset.PWord
strCnn = strDSN & strDBQ & strDbPWD & strPWD & ";FIL=MS Access"

Since I had little success finding documentation on what connection string
to use when the Access database has a database password, I thought I'd
pass
along my results. It would be nice to know why a connection string that
works
on Windows XP doesn't work on Windows 2000.

Sandy





"Peter Jamieson" wrote:

Do you have exactly the same version of Word on both machines? (as in
Word
Help|About)

Can you post the details (i.e. the code, and the details of what each
parameter actually contains when the statement is executed) of your
OpenDataSource statement here please?

Is the database in the same folder in each case? Is it on the local
machine,
or on a network path? Could there be a security/permissions issue?

Peter Jamieson
"Sandra Miller" wrote in message
ink.net...
I am using VB.Net to automate Word 2003 mailmerge; the datasource is a
Microsoft Access database that has a database password. The code works
fine
on my development computer which has Windows XP Professional (SP2 is not
installed) but it does not work on my deployment computer which has
Windows
2000, SP4 installed. Both computers have Word 2003 installed. I thought
it
might be a password problem but I removed the password and am still
getting
the same error: "Word was unable to open the datasource."

Any help that you can provide would be greatly appreciated.

Thanks,
Sandy






  #5   Report Post  
Sandra Miller
 
Posts: n/a
Default

Peter:

I've finally given up trying to figure out the difference. I check my
Windows XP machine - no DSN. However, as a test, I went ahead and created a
system DSN on the Windows 2000 machine. The original code still didn't work.
Go figure. Although I hate these kinds of mysteries, at least I have a
workable solution. And it's back to other problems.

Thanks for all your help and suggestions.

Sandy


"Peter Jamieson" wrote in message
...
The only thing(s) that make sense to me are that either
a. you have a DSN matching "DSN=" &
IO.Path.GetFileNameWithoutExtension(mclsAsset.IMDb ) (in essence) on your
WinXP box but not on your Win2K box. Typically when you install Office it
creates a number of standard ODBC DSN's, but maybe someone created one
with the same name as the Access database you are using or
b. the DSN constructed using "DSN=" &
IO.Path.GetFileNameWithoutExtension(mclsAsset.IMDb ) does not exist. but
for some reason the WinXP box behaves differently (could have a different
version of MDAC, ODBC or Jet?). However, I would be surprised if that was
the case.

Peter Jamieson
"Sandy" wrote in message
...
Peter:

Thanks for your suggestions. I finally figured it solved my problem
although
why the same code did not work on both machines is still a mystery to me.
Both machines have the same version of Word, i.e., the same build. Both
machines use the same Access database, located in the same local
directory so
network and security don't seem to be the issue.

Originally the database was not password protected so I was using the
following code with no problems:

.OpenDataSource(Name:=mstrDataSourceName, LinkToSource:=True,
AddToRecentFiles:=False, SQLStatement:=mstrDataSourceSQL.ToString,
SQLStatement1:=mstrDataSourceSQL1.ToString)

When I added a database password, I change the code to the following:

.OpenDataSource(Connection:=strCnn.ToString, Name:=mstrDataSourceName,
LinkToSource:=True, AddToRecentFiles:=False,
SQLStatement:=mstrDataSourceSQL.ToString,
SQLStatement1:=mstrDataSourceSQL1.ToString,
SubType:=Word.WdMergeSubType.wdMergeSubTypeWord200 0)

whe

strDSN = "DSN=" & IO.Path.GetFileNameWithoutExtension(mclsAsset.IMDb )
strDBQ = ";DBQ=" & IO.Path.Combine(mclsAsset.Directory, mclsAsset.IMDb)
strPWD = ";PWD=" & mclsAsset.PWord
strCnn = strDSN & strDBQ & strPWD & ";FIL=MS Access"

This worked fine on my Windows XP computer but not my Windows 2000. After
much trial & error I came up with a strCnn that now works on both
machines:

strDSN = "DSN=MS Access Database"
strDBQ = ";DBQ=" & IO.Path.Combine(mclsAsset.Directory, mclsAsset.IMDb)
strPWD = ";PWD=" & mclsAsset.PWord
strDbPWD = ";Database Password=" & mclsAsset.PWord
strCnn = strDSN & strDBQ & strDbPWD & strPWD & ";FIL=MS Access"

Since I had little success finding documentation on what connection
string
to use when the Access database has a database password, I thought I'd
pass
along my results. It would be nice to know why a connection string that
works
on Windows XP doesn't work on Windows 2000.

Sandy





"Peter Jamieson" wrote:

Do you have exactly the same version of Word on both machines? (as in
Word
Help|About)

Can you post the details (i.e. the code, and the details of what each
parameter actually contains when the statement is executed) of your
OpenDataSource statement here please?

Is the database in the same folder in each case? Is it on the local
machine,
or on a network path? Could there be a security/permissions issue?

Peter Jamieson
"Sandra Miller" wrote in message
ink.net...
I am using VB.Net to automate Word 2003 mailmerge; the datasource is a
Microsoft Access database that has a database password. The code works
fine
on my development computer which has Windows XP Professional (SP2 is
not
installed) but it does not work on my deployment computer which has
Windows
2000, SP4 installed. Both computers have Word 2003 installed. I thought
it
might be a password problem but I removed the password and am still
getting
the same error: "Word was unable to open the datasource."

Any help that you can provide would be greatly appreciated.

Thanks,
Sandy








Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get all my Word documents within one Word window RobJacobs Microsoft Word Help 5 April 12th 05 03:04 AM
Cannot open Word document in a Windows XP machine. Thomas Microsoft Word Help 0 March 3rd 05 09:57 AM
How do i open a microsoft office word document in microsoft works leona Microsoft Word Help 2 February 7th 05 03:19 PM
How do I open a WORD document in windows ME version of Works?? tamz0526 Microsoft Word Help 2 January 20th 05 04:51 AM
cant open mailmerge datasource saj via OfficeKB.com Mailmerge 0 January 5th 05 03:19 PM


All times are GMT +1. The time now is 06:37 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"