Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Import VFP6 Tables into Excel/Word
Message
De
09/06/1999 03:24:28
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00207594
Message ID:
00227786
Vues:
42
Hi Marcus,
This works with w95&w97 and VFP5-6 as well. ISAM (indexed sequential access method) driver problems are not related with VFP but office components. In MS KB there are a lot of mind confusing causes (and nearly no one neat solution) for it to occur. Users might have installed office with data access option unchecked, path to driver in windows registry might be wrong (FoxPro 2.5=C:\WINDOWS\SYSTEM\xbs110.dll), dll might be corrupt (Msxbse35.dll) and so on. After releasing a new VFP6 version with ODBC drivers selected might it be that Foxpro driver info overwritten ?
Try directly using word and getting data from a free foxpro or dbaseIII table. I would bet it would fail too but I don't like gambling in windows world :)
As far as I could remember Rick Mangum hit similar problem and solved reinstalling office with data access options. Contact him for exact story and solution.
Unfortunately I don't have one neat suggestion. Here is "Visual FP tables" way :
  cDSN = "DSN=Visual FoxPro Tables;UID=;PWD=;"
  cSourceDb = "SourceDB="+home()+"SAMPLES\DATA\Testdata.dbc"
  cSourceType = ";SourceType=DBC;"
  cOther = "Exclusive=No;BackgroundFetch=No;Collate=Machine;"
  cSQLStatement = "SELECT * FROM employee where title like [Sales%]"
The downside word wants to access to table exclusively. That's why I prefer select into a free table way.
Good luck.
Cetin
>Cetin,
>I've clipped this from a reply you gave about 6 weeks ago. I use similar code, specifically "DSN=FoxPro Files;DBQ=...." Since releasing a version created on VFP6 I have several user now getting "could not find installable ISAM". Presumably this is because MS has no longer supports the Foxpro Files driver in favor of the new Visual FoxPro Tables driver. MS's solution was to use the new driver. I haven't been able to get my code to work with the new driver. How about you? Thanks for you input.
>
>Marcus.
>
>
>Here is a code portion from my mmerge class that works with w95&w97 using word.basic :
lcAlias = alias()		&& Save current alias if any
>>
>>lcFreeTableName = "F"+right(sys(2015),7) && Create a temp table name
>>* Word doesn't like table names that are not in 8.3 format
>>
>>&tcSQL into table (lcFreeTableName)	&& Select recs into a temp table
>>
>>lcFreeTable = alias()
>>lcDefDir = sys(5)+curdir()
>>* Prepare DSN strings
>>cDSN = "DSN=FoxPro Files;DBQ="+lcDefDir+";DefaultDir="+lcDefDir+";"
>>cSourceDB = ""
>>cSourceType = ""
>>cOther = "DriverId=536;MaxBufferSize=512;PageTimeout=5;"
>>cDataSource = dbf(lcFreeTable)
>>cSQLStatement = "SELECT * FROM "+lcFreeTableName+".dbf"
>>*....
>>PUBLIC oWordDocument
>>*....
>>oWordDocument=createobject("word.basic")	&& Create word object
>>WITH oWordDocument
>>*...
>> .MailMergeOpenDataSource(cDatasource,,, 1 ,,,,,,,;
>>   cDSN+cSourceDb+cSourceType+cOther, cSQLStatement)
>> && Open data source - Link to source, fastest AFAIK
cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform