Showing posts with label unable. Show all posts
Showing posts with label unable. Show all posts

Wednesday, March 28, 2012

how to create mail merge with word 2003 and sql server 2000 as database

hi, i have the following command and generated an error :
"word was unable to open the data source"

any help will be greatly appreciated.

Thanks in advance.

Jude

Private Sub Command1_Click()

Dim oMainDoc As Word.Document
Dim oSel As Word.Selection
Dim sDBPath As String

'Start a new main document for the mail merge.
Set oMainDoc = oApp.Documents.Add

With oMainDoc.MailMerge

.MainDocumentType = wdFormLetters

.OpenDataSource Name:="", _
connection:="DSN=JLU;DATABASE=PAMI_DB;UID=;pwd=;", _
sqlstatement:="select * from TBLUSERINFO"
'Add the field codes to the document to create the form letter.
With .Fields
Set oSel = oApp.Selection
.Add oSel.Range, "USERID"
oSel.TypeParagraph
.Add oSel.Range, "LASTNAME"
oSel.TypeParagraph
.Add oSel.Range, "FIRSTNAME"
oSel.TypeText ", "
.Add oSel.Range, "MI"
oSel.TypeParagraph
oSel.TypeParagraph
oSel.TypeText "Dear "
.Add oSel.Range, "FULLNAME"
oSel.TypeText ","
oSel.TypeParagraph
oSel.TypeParagraph
oSel.TypeText " This letter is to inform you..."
oSel.TypeParagraph
oSel.TypeParagraph
oSel.TypeText "Sincerely, [Your Name Here]"
End With
End With

'Perform the mail merge to a new document.
With oMainDoc
.MailMerge.Destination = wdSendToNewDocument
.MailMerge.Execute Pause:=False
End With

End SubMake sure your connection string is valid.|||hi, tried this one but no luck again. it gave no error but my computer does not have any activity.

With oMainDoc.MailMerge

.MainDocumentType = wdFormLetters
.OpenDataSource Name:="", _
connection:="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=pami_db;Data Source=JLU", _
sqlstatement:="select * from TBLUSERINFO", SubType:=wdMergeSubTypeWord2000
With .Fields
Set oSel = oApp.Selection
.Add oSel.Range, "USERID"
oSel.TypeParagraph
.Add oSel.Range, "LASTNAME"
oSel.TypeParagraph
.Add oSel.Range, "FIRSTNAME"
oSel.TypeText ", "
.Add oSel.Range, "MI"
oSel.TypeParagraph
oSel.TypeParagraph
oSel.TypeText "Dear "
.Add oSel.Range, "FULLNAME"
oSel.TypeText ","
oSel.TypeParagraph
oSel.TypeParagraph
oSel.TypeText " This letter is to inform you..."
oSel.TypeParagraph
oSel.TypeParagraph
oSel.TypeText "Sincerely, [Your Name Here]"
End With
End With

With oMainDoc
.MailMerge.Destination = wdSendToNewDocument
.MailMerge.Execute Pause:=False
End With

Friday, March 23, 2012

how to create Crystal Report 7 from password protected Access 97

Dear Mr.Babu (Qmax) and All,

I am using Crystal Report 7 and MS Access 97 with VB6.0.
and I am unable to generate report if Access is password protected.

I have seen ur below code for the above problm in dev-archive

crCommon.LogonInfo(0)= "dsn=;uid=;pwd=MyPassword;dsq="
crCommon.DataFiles(0) = "C:\My Document\db.mdb"

but LogonInfo() is not available in my VB6.0.?

Pls. help me to solve this.

thanks and Regards,
V.K.VenkatesanDear Mr.Babu (Qmax) and All,

Finally, I have solved my problem... just by reinstalling VB6.0...

Thanks and Regards,
Venkat

Monday, March 12, 2012

How to create a new user.

Hi!

I have downloaded the MSDE from the Microsoft site.

The installation of Forums Stater Kit unable to add ASPNET account in MSDE users list.

Can anyone tell me how i should add this user by myself in to MSDE users.

i don't have any enterprise manager etc. thing. Just MSDE.

and also what will be the password for this account [ASPNET]http://www.1000files.com/Software_Development/Databases_and_Networks/web_based_msde_admin_tool_-_Shusheng_SQL_Tool_3887_Review.html is a link to a free web based admin tool. ASPNET is automagically created when you installed ASP.NET and the .net framework. You won't know the password. HTH