Code Comments
Programming Forum and web based access to our favorite programming groups.Could anyone tell me how to do use the mailmerge OpenDataSource function
from within powerbuilder.
In VB this works :
Word.Application.ActiveDocument.MailMerge.OpenDataSource(Name:="",
Connection:="DSN=testdsn;UID=testuid;PWD=testpwd", SQLStatement:="SELECT *
FROM PERSON", SQLStatement1:="")
If I try the same thing in Powerbuilder I get Error calling external object
function opendatasource .... :
obj_mail_merge.OpenDataSource("", "", "", "", "", "", "", "", "","","",
"DSN=testdsn;UID=testuid;PWD=testpwd", "SELECT * FROM PERSON", "")
obj_mail_merge contains the same path as the VB example.
It's probably to do with the empty parameters i'm using being incorrect, but
I've tried all the variations I can think off.
I can use obj_mailmerge.DataSource.Querystring to set the SQL, but I cannot
find away of setting the DSN this way.
Any help most appreciated.
Steve.
Post Follow-up to this messageHallo Steve,
have a look to the OLE-Programing
Example (Powerbuilder 6.5):
OLEObject ole_dokument
ole_dokument = CREATE OLEObject
ll_ret = ole_dokument.ConnectToNewObject("Word.Application")
IF ll_ret <> 0 THEN
DESTROY ole_dokument
MessageBox("Ablage", "Kann MS-Word-Verbindung nicht herstellen." + &
"(ret=" + string(ll_ret) + ")", StopSign!)
RETURN
ELSE
******* maybe here *****
ole_dokument.MailMerge.OpenDataSource(Name:="",
Connection:="DSN=testdsn;UID=testuid;PWD=testpwd",
SQLStatement:="SELECT *
FROM PERSON", SQLStatement1:="")
****************************
ole_dokument.Application.Quit
ole_dokument.DisconnectObject()
DESTROY ole_dokument
END IF
--
Manfred Maier
N 48° 22' 36,48" --- E 10° 49' 43,17" --- (WGS84)
"Steve Cooper" <steve@stokesay.com> schrieb im Newsbeitrag
news:43ufd.158906$BI5.100343@fe2.news.blueyonder.co.uk...
> Could anyone tell me how to do use the mailmerge OpenDataSource function
> from within powerbuilder.
>
> In VB this works :
>
> Word.Application.ActiveDocument.MailMerge.OpenDataSource(Name:="",
> Connection:="DSN=testdsn;UID=testuid;PWD=testpwd", SQLStatement:="SELECT *
> FROM PERSON", SQLStatement1:="")
>
> If I try the same thing in Powerbuilder I get Error calling external
object
> function opendatasource .... :
>
> obj_mail_merge.OpenDataSource("", "", "", "", "", "", "", "", "","","",
> "DSN=testdsn;UID=testuid;PWD=testpwd", "SELECT * FROM PERSON", "")
>
> obj_mail_merge contains the same path as the VB example.
>
> It's probably to do with the empty parameters i'm using being incorrect,
but
> I've tried all the variations I can think off.
>
> I can use obj_mailmerge.DataSource.Querystring to set the SQL, but I
cannot
> find away of setting the DSN this way.
>
> Any help most appreciated.
>
> Steve.
>
>
>
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.