Mailmerge in VFP8

Microsoft Visual FoxPro - Programmer Exchange

Richard
Hello all

I’m having a problem using mailmerge from VFP8 trying to use a view as the source
Using a table works fine but the fields I need are in different tables. The code I’m using is from the samples in the solution database

SELECT (cTable

WITH THISFORM.mailmerge
	.cAppTitle = "DPRS"		&& 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 = "c:\mailtest.doc
                .nTemplate = 1	&& type of main document (Word only, 1 = form letter;
                                                2  = label; 3 = envelope; 4 = catalog; default = 1
--------->	.cAlias = "roster"	    && alias of source table or view ******************
	.cDBCTable = DBF()		&& table name if table is part of a DB
	.cDBCName = DBC()		&& DBC name if source table is part of a DB
	ACOPY(gaTemp, .aAutoFields)	&& fill in array of field names to be use
	.MakeOutput()				&& do the merg
ENDWIT

cTable is set earlier in the code and contains “roster”. (without the apostrophes.

The error I get is

Error #1562 in getsqlst(13); cannot find object c:\docume~1\Richard\local~1\temp\FXI4002X.tmp in the databas

I also get a message when using the tables that work that FoxPro Files ODBC driver can’t be found. I have OBDC32.dll and VFPODBC.dll in the Windows directory
Can views be used with Word? Is rthere code somewhere showing how views can be used
Any help would be appreciated

TIA - Richar
                                            
Wolfgang
Hello Richard!

I think
.cDBCTable = DBF() && table name if table is part of a DBC
should be
.cDBCTable = Name_of_the_View && there should be _no_ blanks in the name of
the View


-- 
_________________

MFG
Wolfgang Schmale

MS Visual FoxPro MVP