Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ODBC and Excel
Message
De
04/09/1997 04:12:19
 
 
À
03/09/1997 20:30:00
Stephen Bridgett
Stephen Bridgett Consulting
Gloucester, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Divers
Thread ID:
00048412
Message ID:
00048448
Vues:
24
>Hi Folks
>Has anyone had difficulty setting the 'Rows Scanned' option on the Excel ODBC driver to 0 (zero). The defaul is 8 and the range is 1-16 and 0. Zero is documented but I cannot get the ODBC Administrator to accept it.
>
>The problem is that after 16 (max) empty cells, the driver returns null data for a column. If data should happen to begin on the 17+ row, too bad.
>
>I have a multi column Worksheet and I am importing the data to Fox. Not all columns have data on row 1.
>
>Has anyone had a similar problem or perhaps knows of a newer driver. The driver I am using is ODBCJT32.DLL, dated 12/2/96.
>
>Thanks

Hello,

ODBC is already difficult to use with plain and organised data structures
(SQL engines). I would definitely avoid using it for data imports of
thosespreadsheet or other untidy formats.

My recent experience has been that Excel is a splendid OLE server including
for data import (where i test for column existence, data integrity and so on)

try this :

LOCAL cFileName

cFileName = GETFILE("xls")
SET MESSAGE TO "opening Excel OLE"
oExcel=getobject(cFileName)
SET MESSAGE TO "cells read starting"
FOR i=1 TO 10
FOR j=1 TO 100
v = oExcel.Sheets(1).Cells(i,j).Value
ENDFOR
SET MESSAGE TO ALLTRIM(STR(i*100))+ " cells read"
ENDFOR

If you use VFP 5 you can even use the elegant FOR EACH instruction
ON any Excel RANGE instead for those 2 clumsy FOR loops.

Only pb : this is obviousy not as fast as direct ODBC import.

François
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform