Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP mailmerge error: Unable to Open Datasource

Jay9988

Programmer
Mar 2, 2023
52
ID
Hi all,
I have VFP Application to launch Word mailmerge window, and I used mailmrge.vcx class
the code is below
Code:
WITH THISFORM._mailmerge
       .cAppTitle = "Kontrak Sewa"    && application name, used in Alerts  
       .nWordProc = 1                    && word processor (1 = Word 6+; 2 = CommaDelim; or user-defined (see below); default = 1)
       .nNewDoc = 2                    && is it a new doc (1 = new, 2 = existing; default = 1)
       .cdocname=mdrive+mfile
       .nTemplate = 1                    && type of main document (Word only, 1 = form letter; 2 = label; 3 = envelope; 4 = catalog; default = 1)
       .cAlias = ALIAS()                && alias of source table or view
        ACOPY(aflds, .aAutoFields)        && fill in array of field names to be used
       .MakeOutput()                    && do the merge
      ENDWITH

When the application run on computer with Office 2021 installed, causing error: "Unable to open datasource". I have installed VFP OLE DB driver.

I think maybe the vcx is not compatible with office 2021, because the application is running well with Office 2019 or below.

Is the anyway I could fix this?
and also, with the code above, the datasource is an alias (opened table). How could I modify the code if I want the free table (dbf file) to be the datasource?

Many thanks
 

Part and Inventory Search

Sponsor

Back
Top