Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Attaching datasource to Word XP
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00709221
Message ID:
00709767
Views:
13
Lee,
lcDSN = "DSN="+lcDSN+";SourceDB="+FullPath(lcDBC)+";SourceType=DBC;"
lcDSN is the MailMerge DSN name.
lcDBC is the Database name.

I've setup an ODBC User DSN using the "Microsoft Visual FoxPro Driver"

I then create a Table in a Database to hold the MailMerge data this enables long field names for more descriptive Merge Field names.

Do you have the process working with other versions of Word?

>Caroline,
>
>I am still having problems.
>Your OpenDataSource seems much simpler than mine, which I LIKE SIMPLE.
>In trying to compare the difference to see WHY I still cannot attach the data source the only thing that might be different is my value for the DSN.
>What are you setting this value to?
>
>I am not opposed to change, just so long as I get this _____ thing working.
>
>Thanks for your help.
>Lee Raulerson
>
>
>Lee,
>
>I just recently had the exact same problem and all I did was to keep the code exactly the same as it had previously been to run with other versions of Word, I just make the change below to tell word to use the Word2000 ODBC DataSource if it was the XP version.
>
>The code I use is as follows:
>
>lcDSN = "DSN="+lcDSN+";SourceDB="+FullPath(lcDBC)+";SourceType=DBC;"
>lcSQLStatement = [SELECT * FROM ]+lcTable
>
>If This.WordVersion = 10
>  .OpenDataSource(,,,.T.,,,,,,,,lcDSN,lcSQLStatement,,,wdMergeSubTypeWord2000)
>Else
>  .OpenDataSource(,,,.T.,,,,,,,,lcDSN,lcSQLStatement)
>EndIf
>
>HTH
>Caroline
Caroline
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform