Solved

Word Template Mail merge with vb.net

Posted on 2016-11-09
4
38 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
Comment Utility
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
Comment Utility
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
Comment Utility
"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
Comment Utility
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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Create XML 5 30
Spacing between controls 4 15
Report Builder 9 24
Achieve json result 2 24
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

771 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

12 Experts available now in Live!

Get 1:1 Help Now