English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories
0

excel file?
i have to read an excel file from the first record to the last... but what i really want to read it from last to first,,, i don't want to open up excel file internally so what are my alternatives?
Category: Computers & Internet > Software

2006-09-02 13:33:06 · 2 answers · asked by David K 1 in Computers & Internet Programming & Design

2 answers

if you want to open Excel file in your program, you can use ADO to open them. use this syntax for ConnectionString of your ADOConnection:

ado_con.ConnectionString = 'Provider=Microsoft.Jet.OLEDB.4.0; Data Source='c:\isaac.xls;Extended Properties=Excel 8.0;'

the important part is Extended Properties=Excel 8.0
it says that we are openning an excel file, not a acess file (mdb)

then, you can open tables of that file (the sheets) according:

if your Sheet Name is Sheet1
then your table name is [Sheet1$]
the [ and ] and $ is required

2006-09-02 13:46:15 · answer #1 · answered by IsaacArsenal 3 · 0 0

Another way is JUST link your Excel file to Access (which is I think the most efficient solution to your problem). And when you finished linking up, create a query, but there must be a point where you can read it from last to first, like sequence field:

SELECT *
FROM [Excel Table]
ORDER BY [SEQ] DESC

2006-09-02 15:42:47 · answer #2 · answered by VBACCESSpert 5 · 0 0

fedest.com, questions and answers