Connecting Tech Pros Worldwide Forums | Help | Site Map

uploading excel file and extracting the image to a folder

Newbie
 
Join Date: Oct 2006
Location: North West England
Posts: 1
#1: Oct 6 '06
Hi,

My 1st post ..

I'm writing an import routine to open a dynamically uploaded excel file, import the data into an MS SQL database, save an image which is always in the same location - named 'picture4', close the file and then delete it.

Text/numeric information I can manipulate no problem since I discovered I must 1st set a Named Range, however I cannot figure out how to access and extract the image and save it to the server.

I've been searching for a few days now to no avail. There's a wealth of information doing the reverse, but nothing on this topic.

If anyone has experience of doing this I'd be delighted to hear from you.

My current stripped down basic code is as follows:

Expand|Select|Wrap|Line Numbers
  1. <%
  2. strDriver = "Driver={Microsoft Excel Driver (*.xls)};" & _
  3. "DBQ=PATH_TOXL_FILE.xls;"  
  4. Set objConn = Server.CreateObject("ADODB.Connection")  
  5. objConn.Open strDriver  
  6.  
  7. strSELECT = "SELECT * from `spec_sheet`" 
  8. Set objRS = Server.CreateObject("ADODB.Recordset")  
  9. objRS.Open strSELECT, objConn 
  10.  
  11.     Response.Write "<table border=1 ><tr>"  
  12.  
  13.        For i = 0 to (objRS.Fields.Count - 1)  
  14.          Response.Write "<td><font face=&quot;MS Gothic&quot;><B>" & objRS(i).Name & "</B></font></td>"  
  15.        Next  
  16.  
  17.        While Not objRS.EOF 
  18.  
  19.          Response.Write "</tr><tr>"  
  20.  
  21.          For i = 0 to (objRS.Fields.Count - 1)      
  22.            %><td><font face="MS Gothic"><%'=objRS(i).Name%> : <%=objRS(i)%></font></td><%  
  23.          Next  
  24.  
  25.          objRS.MoveNext  
  26.  
  27.        Wend  
  28.  
  29.     Response.Write "</tr></table>" 
  30.  
  31. objRS.Close
  32. objConn.Close
  33. Set objRS = Nothing
  34. %>
  35.  
Many thanks in advance,
8hours

Reply