Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 14th, 2004, 01:08 PM
spydude006 spydude006 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 spydude006 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation Search from Excel files

Hi guys,
I am new to this ASP language, I want some script to do this: User search thorugh a form, then the script extracts
the data required from an Microsoft Excel file, and finally outputs on a HTML or some page.
I worked with Php, but never touched ASP. So, please help me, My Boss needs me to do this....

Thank you for your help

Srinath

Reply With Quote
  #2  
Old October 14th, 2004, 05:07 PM
spungebob spungebob is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: Dover
Posts: 128 spungebob User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 39 sec
Reputation Power: 5
multiple methods to accomplish this task.

Try something like this in your asp page or try creating a odbc
and accessing it that way!


<%
Dim oComm, oRs
set oRs = CreateObject("ADODB.Recordset")
set oConn = Server.CreateObject("ADODB.Connection")
oconn.Open "Driver={Microsoft Excel Driver (*.xls)};" & _
"DriverId=790;" & _
"Dbq=e:\production\;" & _
"DefaultDir=e:\production"

oRs.Open "Select * From gow0433_call_list.xls", oConn, adOpenForwardOnly, adLockReadOnly
Do while not oRs.EOF
Response.Write oRs("phone")
oRs.movenext
Loop
%>

Reply With Quote
  #3  
Old October 19th, 2004, 02:25 PM
leoj2020 leoj2020 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 1 leoj2020 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Exclamation Using recordsets with Excel

I tried this code but cannot get it to work! Perhaps you could explain the connection object further?? I tried 2 other connection objects:

strConn = "Driver={Microsoft Excel Driver (*.xls)};DBQ=c:\Excel\Test.xls"

strConn="Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=C:\Excel\test.xls;Defaul tDir=c:\excel"


These seemed to work. However, when I did the sql query -- Select * from test.xls" it kept telling me that it couldn't find this object. I tried all fully qualified names, putting in the wwwroot directory, etc. Nothing would work.

I would love to use this code if you are sure it works. Maybe there was a small detail left out?? Please help me!! 8-(

Thanks.

Reply With Quote
  #4  
Old October 19th, 2004, 05:20 PM
Leslie's Avatar
Leslie Leslie is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Honolulu
Posts: 184 Leslie User rank is Corporal (100 - 500 Reputation Level)Leslie User rank is Corporal (100 - 500 Reputation Level)Leslie User rank is Corporal (100 - 500 Reputation Level)Leslie User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 20 h 29 m 2 sec
Reputation Power: 8
Nope, looks like he got it right ... here more connection examples ... they are actually easy to find on the web, just one of many:

http://www.simongibson.com/intranet/adoodbc/

maybe you have a typo somewhere in your statement. Try testing each statement one by one by inserting debug code (response.write if you need to) to be sure you have a valid object (i.e response write a property of the connection strConn to be sure it was really created)

Reply With Quote
  #5  
Old October 19th, 2004, 05:23 PM
Leslie's Avatar
Leslie Leslie is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Honolulu
Posts: 184 Leslie User rank is Corporal (100 - 500 Reputation Level)Leslie User rank is Corporal (100 - 500 Reputation Level)Leslie User rank is Corporal (100 - 500 Reputation Level)Leslie User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 20 h 29 m 2 sec
Reputation Power: 8
Also ... the Excel Driver has to be on your webserver, of course. Many times apps typically installed on our workstation are not installed on a webserver, such as MS Office products so check that first.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Search from Excel files


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway