|
-
Nov 29th, 2005, 05:19 PM
#1
Thread Starter
Junior Member
Password protected database & Word
Hi: Using VB6, Access2000, Word2000
I trying to do a mailmerge using VB6 & Word2000 with an Access2000
password protected database. I don't know how to provide the password
to the string.
Normally when accesing the db I connect as follows:
VB Code:
'adoConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
'" Data Source=\\BigDaddy\Datalib\MegaOne.mdb; Persist Security Info=False; Jet OLEDB:Database Password=DogDayAfternoon23x "
I tried the above code but got errors
The following is what I'm currently using, but it prompts me to
enter the password, which I do not want to happen once itgets into production.
VB Code:
' Set the mail merge data source as the MegaOne.mdb database.
objWord.MailMerge.OpenDataSource _
Name:="\\BigDaddy\Datalib\MegaOne.mdb", _
LinkToSource:=True, _
Connection:="TABLE Customers", _
SQLStatement:=" SELECT " & _
" CustAuthorizedFirstName, CustAuthorizedLastName," & _
" CustDepartment, CustCompanyName, " & _
" CustAddress1, CustAddress2, " & _
" CustCity, CustState, CustZipcode, " & _
" CustBalance " & _
" FROM " & _
" [Customers]" & _
" Where " & _
" CustBalance > 0 "
The second problem I'm having here is that the document is set with a font size of 12 but when prints, the first word of the merged fields are printed with a font size of 10 instead of the original document which as I stated is set for 12.
Can someone shed some light?
Thanks
-
Nov 30th, 2005, 05:04 PM
#2
Thread Starter
Junior Member
Re: Password protected database & Word
Anyone out there, Need HELP with this.
Thanks
-
Dec 1st, 2005, 09:05 PM
#3
Re: Password protected database & Word
According to this page (which is an explanation of why things like this can be a bad idea!) there is a PasswordDocument parameter, which I think should be inserted like this:
VB Code:
...
Name:="\\BigDaddy\Datalib\MegaOne.mdb", _
PasswordDocument:="[i]YourPassword[/i]", _
LinkToSource:=True, _
...
-
Dec 7th, 2005, 07:27 PM
#4
Thread Starter
Junior Member
Re: Password protected database & Word
Thanks for responding si_the_geek. Sorry for the late response but I was under the weather for a bit. Back at work now.
I tried your suggestionn and it still prompts me for the database password, appearently it a document password instead of the database password.
Any other thoughts???
And how about the changing of the font size problem?
Again thanks
-
Dec 8th, 2005, 08:26 AM
#5
New Member
Re: Password protected database & Word
Got this from the Microsoft TechNet site:
VB Code:
' Open database for exclusive access by using current password. To
' get exclusive access, you must set the Options argument to True.
Set dbsDB = OpenDatabase(Name:=strDBPath, _
Options:=True, _
ReadOnly:=False, _
Connect:=strOpenPwd)
Looks like you would assign you parameters to the variables starting with 'str'
Hope that helps !
-
Dec 8th, 2005, 08:31 AM
#6
New Member
Re: Password protected database & Word
http://www.microsoft.com/technet/pro...art4/ch18.mspx
Sorry, the above is the link where I got some info ......
-
Dec 8th, 2005, 10:20 PM
#7
Thread Starter
Junior Member
Re: Password protected database & Word
Thanks for the information & the link ModusOperandi
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|