SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2006
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question read through Excel File

    hi i am in problem i want to connect excel file i want to read data from Excel file my application give me this error .

    i have
    os windowsXP or office 2000

    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified


    this is my code :

    <&#37;
    Set cnnExcel = Server.CreateObject("ADODB.Connection")
    sspath = server.mapPath ("./testCSVs/40.xls")
    cnnExcel.Open "DBQ=" & sspath & ";" & "DRIVER={Microsoft Excel Driver(*.xls)};"
    response.write sspath
    response.end

    'Setting excel recordset:

    Set rstExcel = Server.CreateObject("ADODB.Recordset")
    'q = "SELECT * FROM TestData where relationship <> 'SELF' and Name =" &
    q = "SELECT * FROM 40"
    rstExcel.Open q, cnnExcel, adOpenStatic, adLockPessimistic
    response.write srstExcel.recordCount
    rstExcel.close

    %>

  2. #2
    SitePoint Member
    Join Date
    Dec 2006
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •