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

Re: Mailmerge in VFP8 by Wolfgang

Wolfgang
Thu Jan 29 16:40:42 CST 2004

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

--------------------------------
"Richard" <anonymous@discussions.microsoft.com> schrieb im Newsbeitrag
news:87904CCA-508D-4874-B72B-D84D67578937@microsoft.com...
> 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.mailmerge1
> .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 DBC
> .cDBCName = DBC() && DBC name if source table is part of a DBC
> ACOPY(gaTemp, .aAutoFields) && fill in array of field names to be used
> .MakeOutput() && do the merge
> ENDWITH
>
> 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 database
>
> 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 - Richard
>