Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help.... How to write a SQL that will query an Excel file.

Status
Not open for further replies.

andrest

Programmer
Jul 25, 2002
20
CA
Hi! I'm a virtual Rookie when it comes to programming....

I have to import data from a temporary Access Databas.. (it's flushed every time a new record is created and then repopulated).. I store the tables in an Excel file...

How can I, using VB, populate a datagrid with this excel file without creating an OBDC Driver for the Excel file?

I'm very puzzled with this......

Thanks in advance....

Andre
 
ACCESS allows you to link to an Excel spreadsheet thus allowing you to create a query accessing the newly updated data very easily. I don't know if you want to have a permanent link to the file or create one each time you want to access the refreshed data.

I can help you either way just indicate how you and when you want to access the data. Bob Scriver
 
Hi Bob and thanks for the fast reply....

The company I work for have an application that populates a reports database to generate reports and when a new job is selected the database repopulates with different data... But they want me to save that information somewhere... i save that information into an Excel file... a new file is created each time the database repopulates.

Now, I need to query any of the Excel files so they can create reports at any time. How do you query an Excel file without creating an ODBC Driver.

the connection... i think is something like this..

adoConnection = "Provider=MSDASQL.1;Persist Security Info=False; Data Source=D:\test.xls" & "Extended Properties=Excel 8.0;"

what would the query look like.

this is a bit over my head...

Andre.
 
Andre, I will get back to you this evening. I am leaving the office today but will check up on you tonight from home. This can be done with code and I can help you.
Bob Scriver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top