>ODBC Error: [Microsoft}{ODBC Visual FoxPro Driver]Cannot open file d:\rapid version 3\test. >Sql State: S1000 >Return Code: SQL_ERROR >>where the file listed is the DBC linked to the selected table.
#Define MYDBC _samples+"\DATA\testdata.DBC" #Define wdSendToEmail 2 #Define wdSendToFax 3 #Define wdSendToNewDocument 0 #Define wdSendToPrinter 1 cSQLStatement1 = "SELECT * FROM employee where title like [Sales%]" cSQLStatement2 = "" * Be carefull with where clause - where title = [Sales] fails * for ODBC uses ANSI SQL (exact match) * Two strings for first is limited to 255 chars oWordDocument=createobject("word.application") && Create word object With oWordDocument .Documents.Add(sys(5)+curdir()+'mmerge.dot') && Use a predefined template With .ActiveDocument.MailMerge .OpenDataSource(,,,.T.,,,,,,,, ; "DSN=Visual FoxPro Database;SourceDB="+MYDBC+; ";SourceType=DBC;Exclusive=No;",; cSQLStatement1, cSQLStatement2) && Open data source - Link to source .Destination = wdSendToNewDocument .Execute Endwith .Visible = .t. EndwithCetin