Solved

Word Template Mail merge with vb.net

Posted on 2016-11-09
4
65 Views
Last Modified: 2016-11-15
Hello,

Any suggestion how can I do mail merge (word) with vb.net and sql server query.
I have a word template which uses access db.But, now need the vb.net app to connect it with the sql server db.



Cheers
0
Comment
Question by:RIAS
  • 2
  • 2
4 Comments
 
LVL 39

Expert Comment

by:lcohan
ID: 41880721
I think is like you just need to "Change the main data connection to another Microsoft Access database" but this one is SQL database tables instead of Access

https://support.office.com/en-us/article/Change-the-main-data-connection-to-another-Microsoft-Access-database-12376f25-3f74-407e-8ca5-53409cc2bcc3

Just look under "Change the main data connection in the form template" from above links where step 3. says: "3.On the next page of the wizard, click Database (Microsoft SQL Server or Microsoft Office Access only), and then click Next." so just select your SQL Server database and go from there.

And make sure you keep a copy of your original template somewhere safe before making/saving any changes.
1
 

Author Comment

by:RIAS
ID: 41880741
Ok, will give a go.
Need to intiate this from my vb.net app.
Any suggestions
0
 
LVL 39

Accepted Solution

by:
lcohan earned 500 total points
ID: 41880754
"I have a word template which uses access db.But, now need the vb.net app to connect it with the sql server db."

So what's the connection between the word template above and VB .net???
If you just need to connect from VB .net to SQL - that's described for instance here: "VB.NET Database Tutorial - Connecting To Microsoft SQL Server" https://www.youtube.com/watch?v=odrntJn2o98 or here http://vb.net-informations.com/ado.net-dataproviders/ado.net-sqlconnection.htm
1
 

Author Comment

by:RIAS
ID: 41881829
Icohan,

Right now the word is not connected to vb.net.Its a standalone template with connection to access.

I have to now do this:

vb.net app ----connects to word ---which has the sql connection instead of Access

Cheers
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now