Current location: Hot Scripts Forums » Programming Languages » ASP » How to retrieve data from excel file to ASP page?


How to retrieve data from excel file to ASP page?

Reply
  #1 (permalink)  
Old 03-14-05, 12:17 AM
lymni22 lymni22 is offline
New Member
 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question How to retrieve data from excel file to ASP page?

Hello friends

i had my data with excel file.
i want to import my excel data to my sql server database
after that i want add one image file
then i display the records using asp page
i want to know how to retreive records from Excel file to database?

thanks in advance
Lymni
Reply With Quote
  #2 (permalink)  
Old 03-14-05, 11:20 AM
koncept
Guest
 
Posts: n/a
you can treat an excel file like a database, it just a matter of the connection string being used then you treat it just like a table in a database

http://www.able-consulting.com/MDAC/...DriverForExcel
Reply With Quote
  #3 (permalink)  
Old 03-22-05, 10:55 PM
erickoh erickoh is offline
New Member
 
Join Date: Mar 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy

Hi koncept,

I got the driver from the link you provided,

oConn.Open "Driver={Microsoft Excel Driver (*.xls)};" & _
"DriverId=790;" & _
"Dbq=c:\somepath\mySpreadsheet.xls;" & _
"DefaultDir=c:\somepath"

but it still return an error msg as below:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Excel Driver] Cannot open database '(unknown)'. It may not be a database that your application recognizes, or the file may be corrupt.

/eSITE/excel.asp, line 15

Do you know what happen? Can teach me ? Please.
Reply With Quote
  #4 (permalink)  
Old 03-23-05, 10:44 AM
koncept
Guest
 
Posts: n/a
this is the code i am using to open the excel file, im working on extracting data now. this is a new thing, i just knew it was possible

Code:
dim adoCon
dim strCon

Set adoCon = Server.CreateObject("ADODB.Connection")

strcon ="Driver={Microsoft Excel Driver (*.xls)};" & _
		   "DriverId=790;" & _
		   "Dbq=demo.xls;"
'Set an active connection to the Connection object
adoCon.Open strCon
Reply With Quote
  #5 (permalink)  
Old 03-23-05, 10:57 AM
koncept
Guest
 
Posts: n/a
i know i should edit that last post but
this is it, compliments of google n hotscripts

http://www.codeave.com/asp/code.asp?u_log=135

the file with all the stuff im using is called dyne.zip
Attached Files
File Type: zip dyne.zip (3.4 KB, 767 views)
Reply With Quote
  #6 (permalink)  
Old 09-02-05, 06:48 PM
dypsoprogram dypsoprogram is offline
Newbie Coder
 
Join Date: May 2005
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Hi,
U will find another great sample at http://dypso.free.fr/tech

Reply With Quote
  #7 (permalink)  
Old 10-29-07, 05:49 AM
preetinair033 preetinair033 is offline
New Member
 
Join Date: Oct 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
hi konCept,

Thank you for the code to access the excel sheet value and display in asp.
However, I wished to access the data in the second sheet of the workbook in an excel sheet.
could you help me with the code for the same.
regards
milan
Reply With Quote
  #8 (permalink)  
Old 10-29-07, 06:53 AM
preetinair033 preetinair033 is offline
New Member
 
Join Date: Oct 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
hi konCept,

well my issue is sorted out. I am able to retrieve/fetch data from sheet2 of the workbook.

However, I wish to retrieve data from SqL server database and populate the column in Excel and that too in second sheet through ASP.



Could you help me with the Code?


regards
Milan
Reply With Quote
  #9 (permalink)  
Old 12-13-07, 08:11 PM
charan_124 charan_124 is offline
New Member
 
Join Date: Dec 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Extract from Excel sheets

Hai Preeti,

Can you help me by providing the code , how to connect the 2nd worksheet of excel. I found lot of codes connecting by "name range" only.

Expecting your reply

Thanks
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Classified Ads skipper23 Perl 3 11-22-05 02:22 AM
run macro excel with ASP page.. sal21 ASP 3 09-02-05 06:50 PM
Export to excel file asp traceMe ASP 2 08-01-04 09:07 PM
Classified Ads skipper23 Perl 2 12-30-03 03:43 AM
Upload file to table so ONLY files tied to primary key are displayed in record? grafixDummy PHP 4 12-20-03 04:28 PM


All times are GMT -5. The time now is 03:18 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.