Thanks for that.... I will look into it.
Cheers
Chris
oki....
I have created a UDL file that will connect to the server.... however I am
unable to connect the UDL file to the C# code.
The code i am using is :-
...
Object oConnection = new OleDbConnection("File Name = c:\\test.udl");
...
...
wrdMailMerge.OpenDataSource("", ref oFileFormat, ref oMissing, ref oMissing,
ref oTrue, ref oMissing, ref oMissing, ref oMissing, ref oFalse, ref
oMissing, ref oMissing, ref oConnection, ref oQuery, ref oMissing, ref
oMissing, ref oSubType);
...
And error is....
Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))
I presume the mismatch is with the connection object but not sure were I am
going wrong.
Any help please?
Many thanks
Chris
> Thanks for that.... I will look into it.
>
[quoted text clipped - 55 lines]
> > >
> > > ------------------
Peter Jamieson - 31 Oct 2007 14:19 GMT
Set the name parameter of the OpenDataSOurce to be the pathname of the
.odc/.udl, e.g.
wrdMailMerge.OpenDataSource("c:\\test.udl", ref oFileFormat, ref oMissing,
ref oMissing,
ref oTrue, ref oMissing, ref oMissing, ref oMissing, ref oFalse, ref
oMissing, ref oMissing, ref oConnection, ref oQuery, ref oMissing, ref
oMissing, ref oSubType);
Typically you would not need to provide an Connection parameter (the info.
is in the .udl) or any particular SubType (i.e. you can probably leave that
as oMissing) but you will need a Query and you may find that you have to
alias any table names it contains, even though it may not be syntactically
necessary.

Signature
Peter Jamieson
http://tips.pjmsn.me.uk
> oki....
>
[quoted text clipped - 97 lines]
>> > >
>> > > ------------------