LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

getting info out of an excel file like a database

Hi,

The problem i have is that i have to get info out of an excel file like a database. So i have to be able to perform a kind of query, but to an excel file. Is this possible?

lay-out excel file:
number | request | chemical composition
| | C | Mn | Si | ....
125654 | |0.20%|0.10%|0.05%|.....

i should have to be able to search on the number and read the differend % (C, Mn, Si). This % are used in a formula to calculate a value that is used for DAQ

I can do this action with an acces DB, but not with excel. The problem is that they used excel for some years now (where i work) and changing the excel file to a DB would be a very long w
ork.
If someone could help i'd appreciate it

thx
0 Kudos
Message 1 of 5
(2,980 Views)
It has been some time since I've had to do it but I remember using the SQL Toolkit to run a query on Excel. Add a DSN and select Microsoft Excel driver and then Select Workbook to choose the specific Excel file. You should then be able to do a normal SQL query (i.e. Select * from tablename where number = 125654).
Message 2 of 5
(2,980 Views)
I tried it like you said, but i get the error: -2147217865

exception occured.
[Microsoft][ODBC Excel Driver] The microsoft jet database engine could not find the object 'Sheet1'. Make sure the object exists...

So he doesn't seem to recognize a datasheet as a table (if i may compare it like this) when i choose the microsoft Excel driver with the workbook as described in your answer.
Any ideas?
i putted some attachements, maybe they make it easier to understand
Download All
0 Kudos
Message 3 of 5
(2,980 Views)
See the following document. Make the required changes and your attached vi works fine.

http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/862567530005f09c862566ac0076c303?OpenDocument
0 Kudos
Message 4 of 5
(2,980 Views)
A BIG THX

Now it works.
I just have some weird things happening. He doesnt read in all data. He skipps some cells while reading. When i re-enter those particular cells, (in excel) then reads them. I guess its has something to do with the cell format, in case someone has this problem aswell later.

Thx again,

a happy programmer 🙂
0 Kudos
Message 5 of 5
(2,980 Views)