Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MailMerge OpenDataSource SSPI direct SQL Server connection
Hello,
my problem is, that I can't get my OpenDataSource code working well. Word opens another dialog where to choose a DataSource manual. Anyone an idea what I do wrong? I need SSPI connection... string table = "Userlist"; object cString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=KUMAgroup_MSCRM;Data Source=KGRMACRM1;Use Procedure for Prepare=1;Auto Translate=1;Packet Size=4096"; object sqlString = "SELECT * FROM [" + table + "]"; doc.MailMerge.OpenDataSource("", ref oMissing, ref oMissing, ref oTrue, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,ref oMissing, ref oMissing, ref cString, ref sqlString, ref oMissing, ref oFalse, ref oMissing); |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MailMerge OpenDataSource SSPI direct SQL Server connection
To open a SQL Server connection using OLEDB, you have to have a .udl or .odc
file, even when you have provided all the necessary connection details in cString. However, the .odc file (which is just a text file) can be an empty file created in Notepad. Peter Jamieson "Thomas" wrote in message ups.com... Hello, my problem is, that I can't get my OpenDataSource code working well. Word opens another dialog where to choose a DataSource manual. Anyone an idea what I do wrong? I need SSPI connection... string table = "Userlist"; object cString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=KUMAgroup_MSCRM;Data Source=KGRMACRM1;Use Procedure for Prepare=1;Auto Translate=1;Packet Size=4096"; object sqlString = "SELECT * FROM [" + table + "]"; doc.MailMerge.OpenDataSource("", ref oMissing, ref oMissing, ref oTrue, ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,ref oMissing, ref oMissing, ref cString, ref sqlString, ref oMissing, ref oFalse, ref oMissing); |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MailMerge OpenDataSource SSPI direct SQL Server connection
Hello Peter,
To open a SQL Server connection using OLEDB, you have to have a .udl or .odc file, even when you have provided all the necessary connection details in cString. However, the .odc file (which is just a text file) can be an empty file created in Notepad. Thx, now it work, but the connection needs much time to connect the server. The manual way it's fast but with the programmatic ConnectionString it's slow. Any idea? |
#4
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
MailMerge OpenDataSource SSPI direct SQL Server connection
The manual way it's fast but with the programmatic
ConnectionString it's slow. Any idea? Sorry, I don't know what could be causing that. The connection strings I use here have similar settings to yours, and performance is OK. Leaving things out such as the Merge subtype the parameter after "SQLStatement2" does not seem to make much difference. But I am working in quite a benign environment here. You aren't using SQL Server 2005 are you? If so, you should probably try using the new client OLEDB provider SQLNCLI.1. However, I don't see why it would make a significant difference to performance. Peter Jamieson "Thomas" wrote in message oups.com... Hello Peter, To open a SQL Server connection using OLEDB, you have to have a .udl or .odc file, even when you have provided all the necessary connection details in cString. However, the .odc file (which is just a text file) can be an empty file created in Notepad. Thx, now it work, but the connection needs much time to connect the server. The manual way it's fast but with the programmatic ConnectionString it's slow. Any idea? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
mailmerge from access database using DDE connection? | Mailmerge | |||
Connecting to SQL Server for mailmerge | Mailmerge | |||
directly connecting the MailMerge object to MS SQL server | Mailmerge | |||
Using an .odc File to Mailmerge with SQL Server | Mailmerge | |||
Mailmerge Recipients doesn't work with SQL Server | Mailmerge |