[asp] excel upload en dan waardes uitlezen

Pagina: 1
Acties:

  • TeeDee
  • Registratie: Februari 2001
  • Laatst online: 20:51
Hoi,

wat is mijn probleem:

Ik wil een excel file uploaden (dat lukt :))
nu wil ik alle gegevens die in dat excel sheet staan uitlezen. Maar zo'n excel file heeft ook sheets.

Nu is het zo, dat die sheet names niet automatisch uitgelezen worden. Heeft iemand hier een oplossing voor? Of een duwtje in de goede richting?

Heart..pumps blood.Has nothing to do with emotion! Bored


  • TeeDee
  • Registratie: Februari 2001
  • Laatst online: 20:51
laat maar :)

vond nog ergens een stukkie code:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<select name="sheetname">
  <%
    On Error Resume Next 
    Bestandsnaam = session("xls")
    Set cnnExcel = Server.CreateObject("ADODB.Connection")
    cnnExcel.Open "DBQ=d:\xls_files\"&Bestandsnaam & ";DRIVER={Microsoft Excel Driver (*.xls)};"
    set rst = cnnExcel.OpenSchema(20) ' adSchemaTables
    Do Until rst.EOF
    %>
  <option value="<%=rst.Fields("TABLE_NAME")%>"><%=rst.Fields("TABLE_NAME")%></option>
  <%
    rst.MoveNext
      Loop
     Set rst = Nothing
    Set cnnExcel = Nothing  
    %>
</select>

Nu alleen nog ffies d.m.v. dropdowntjes de juiste data koppelen!

Heart..pumps blood.Has nothing to do with emotion! Bored