How can I Open an Excel file in ASP?
I need to "upload" data to my db in SQL. The data is on Excel files and the app is on the intranet, programmed in ASP.
I need the user to upload the excel file to the server... and then, the server must process the file in order to validate data in it and, if it is correct, server must insert the info to my SQL DB.
I know how to generate an Excel file to appear opened in browser to the user... but that is not what I need. The user already has the file, I only need the server to process the file with my algorithm to validate and extract the info to my DB.
Any help will be highly appreciated.
This takes two steps... First, the file must be uploaded. Then, you can use ADODB to open the Excel workbook as if it were a database. Each sheet within the workbook is treated as its own data table.
What do you need to know more about?
Thank you very much.
Now... next question. I know how to make a connection to an ODBC... then I link all my ADODB commands and recordsets with this connection...
How do I make a connection to an Excel file???
I assume then that once the connection is made, recordsets and commands will work exactly the same way, rigth?
Pretty much, yep, that's it. Here is where you can find all kinds of connection strings:
Originally Posted by CybIRO
It Works Perfectly
Thank you very much!!!!
It works perfectly.
I require it to be a dynamic file... and in order to work properly, in the connection line it requires the absolute path on the server. I still don't find the way to use relative paths such as "../MyFile.xls" instead of "c:\Myfolder\MyFile.xls" but... it works anyway.
Code a relative path from the root folder of your site and have it dynamically converted to a physical path as follows:
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)