Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

PB and word mailmerge.
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.




Report this thread to moderator Post Follow-up to this message
Old Post
Steve Cooper
10-26-04 08:58 PM


Re: PB and word mailmerge.
Hallo 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.
>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Manfred Maier
10-26-04 08:58 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PowerBuilder archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:54 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.