export data to Excel

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • atse

    export data to Excel

    Hi experts,

    I retrieve data from the database and display on ASP, then I export these
    data to a file, like Excel (the best) or text file. Is it possible? I think
    it is possible, but how can I do that? Thanks for any help.

    Atse


  • Ray at

    #2
    Re: export data to Excel

    There are a couple of things you can do.

    1. Build your data in a table and add this to the top of your page:
    <% Response.Conten tType = "applicatio n/vnd.ms-excel" %>


    2. Build yourself a comma delimited string and save the string to a file
    with a .csv file and link to it.

    3. Use Office Web Components:
    http://office.microsoft.com/downloads/2002/owc10.aspx. Before you'd go that
    route, read here though. http://support.microsoft.com/?id=317316

    If you need more details on 1 or 2, post back with a sample of your data
    querying and what not.

    Ray at home


    "atse" <dunggaze@yahoo .com> wrote in message
    news:7Vnfb.2069 07$Lnr1.168685@ news01.bloor.is .net.cable.roge rs.com...[color=blue]
    > Hi experts,
    >
    > I retrieve data from the database and display on ASP, then I export these
    > data to a file, like Excel (the best) or text file. Is it possible? I[/color]
    think[color=blue]
    > it is possible, but how can I do that? Thanks for any help.
    >
    > Atse
    >
    >[/color]


    Comment

    • atse

      #3
      Re: export data to Excel

      Thanks Ray. I remember you have given me great helps before. Yes, I really
      want to export a csv file.
      I have big csv files containing customers' contact info. I want to export
      them by zip code and type to respective csv files. What is the simplest way
      to do that? Thanks again.

      Atse


      "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
      news:O6n1R2giDH A.1048@TK2MSFTN GP11.phx.gbl...[color=blue]
      > There are a couple of things you can do.
      >
      > 1. Build your data in a table and add this to the top of your page:
      > <% Response.Conten tType = "applicatio n/vnd.ms-excel" %>
      >
      >
      > 2. Build yourself a comma delimited string and save the string to a file
      > with a .csv file and link to it.
      >
      > 3. Use Office Web Components:
      > http://office.microsoft.com/downloads/2002/owc10.aspx. Before you'd go[/color]
      that[color=blue]
      > route, read here though. http://support.microsoft.com/?id=317316
      >
      > If you need more details on 1 or 2, post back with a sample of your data
      > querying and what not.
      >
      > Ray at home
      >
      >
      > "atse" <dunggaze@yahoo .com> wrote in message
      > news:7Vnfb.2069 07$Lnr1.168685@ news01.bloor.is .net.cable.roge rs.com...[color=green]
      > > Hi experts,
      > >
      > > I retrieve data from the database and display on ASP, then I export[/color][/color]
      these[color=blue][color=green]
      > > data to a file, like Excel (the best) or text file. Is it possible? I[/color]
      > think[color=green]
      > > it is possible, but how can I do that? Thanks for any help.
      > >
      > > Atse
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Ray at

        #4
        Re: export data to Excel

        I will pretend that you have data as such:

        CustID Firstname Lastname Address City State ZIP
        1 Bo Brady 1 Street Somewhere XX 10001
        2 Hope Brady 1 Street Somewhere XX 10001
        3 Jack Deveraux 2 Road Somewhere XX 10002
        4 Jennifer Deveraux 2 Road Somewhere XX 10002
        5 Abe Carver 3 Ave. Somewhere XX 10003
        6 Lexie Carver 3 Ave. Somewhere XX 10003
        7 Tony Dimera 4 Lane Somewhere XX 10004
        8 Rex Dimera 5 Way Somewhere XX 10005
        9 Cassie Dimera 4 Lane Somewhere XX 10004
        10 Greta Von Amberg 6 Swamp Somewhere XX 10006




        So, like, you want a bunch of files like:
        10001.csv, 10002.csv, etc.? Maybe something like this:



        <object runat="server" progid="Scripti ng.FileSystemOb ject"
        id="oFSO"></object>
        <%

        Dim oADO, oRS
        Dim sOutput
        Dim aZIPs, i, sZIP

        Const OUTPUT_PATH = "D:\Path\"


        sSQL = "SELECT DISTINCT(ZIP) FROM Customers"
        Set oADO = Server.CreateOb ject("ADODB.Con nection")
        oADO.Open YourConnectionS tring
        Set oRS = oADO.Execute(sS QL)
        aZIPs = oRS.GetRows()
        oRS.Close : Set oRS = Nothing

        For i = 0 To UBound(aZIPs, 2)
        sZIP = aZIPs(0, i)
        sSQL = "SELECT CustID,Firstnam e,Lastname,Addr ess,City,State, ZIP FROM
        Customers WHERE ZIP='" & sZIP & "'"
        Set oRS = oADO.Execute(sS QL)
        sOutput = oRS.GetString(, ,",",vbCrLf)
        oRS.Close : Set oRS = Nothing
        oFSO.CreateText File(OUTPUT_PAT H & sZIP & ".csv", True).Write sOutput
        Response.Write "<a href=""" & sZIP & ".csv"">Cli ck here to download CSV
        for ZIP code " & sZIP & "</a><br>"
        Next

        oADO.Close : Set oADO = Nothing
        %>



        What that'll do is get all the zips, then loop through them all, query all
        the data for each zip, and write a CSV from each resultset.

        Ray at home





        "atse" <dunggaze@yahoo .com> wrote in message
        news:n8pfb.2075 24$Lnr1.50742@n ews01.bloor.is. net.cable.roger s.com...[color=blue]
        > Thanks Ray. I remember you have given me great helps before. Yes, I really
        > want to export a csv file.
        > I have big csv files containing customers' contact info. I want to export
        > them by zip code and type to respective csv files. What is the simplest[/color]
        way[color=blue]
        > to do that? Thanks again.
        >
        > Atse
        >
        >
        > "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
        > news:O6n1R2giDH A.1048@TK2MSFTN GP11.phx.gbl...[color=green]
        > > There are a couple of things you can do.
        > >
        > > 1. Build your data in a table and add this to the top of your page:
        > > <% Response.Conten tType = "applicatio n/vnd.ms-excel" %>
        > >
        > >
        > > 2. Build yourself a comma delimited string and save the string to a[/color][/color]
        file[color=blue][color=green]
        > > with a .csv file and link to it.
        > >
        > > 3. Use Office Web Components:
        > > http://office.microsoft.com/downloads/2002/owc10.aspx. Before you'd go[/color]
        > that[color=green]
        > > route, read here though. http://support.microsoft.com/?id=317316
        > >
        > > If you need more details on 1 or 2, post back with a sample of your data
        > > querying and what not.
        > >
        > > Ray at home
        > >
        > >
        > > "atse" <dunggaze@yahoo .com> wrote in message
        > > news:7Vnfb.2069 07$Lnr1.168685@ news01.bloor.is .net.cable.roge rs.com...[color=darkred]
        > > > Hi experts,
        > > >
        > > > I retrieve data from the database and display on ASP, then I export[/color][/color]
        > these[color=green][color=darkred]
        > > > data to a file, like Excel (the best) or text file. Is it possible? I[/color]
        > > think[color=darkred]
        > > > it is possible, but how can I do that? Thanks for any help.
        > > >
        > > > Atse
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        • atse

          #5
          Re: export data to Excel

          Great! Ray.

          You know what I want!! Ok, what if retrieve from a .csv (e.g. customer.csv)
          file, instead of the SQL db?
          Further questions are:

          1. I don't know how many groups of Zip (your example has group10001, group
          10002..group 10006. totally 6 groups), and I want to export 6 files, like
          10001.csv; ... 10006.csv which means the number of output file .csv would be
          a variable.

          2. If there is no field name in a .csv file but column/comma/table or A, B,
          C...X in an Excel file, how can I select them?

          3. Actually I have another field name "language" (eng/fre), I want them to
          be exported to files eng_10001.csv, eng_10002.csv, fre_10001.csv,
          fre_10003.csv. Is it possible for me to do that. Of course, I am sure you
          can.

          Thanks again!
          Cheers,

          Atse


          "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
          news:%23%23Mgq1 hiDHA.4024@TK2M SFTNGP11.phx.gb l...[color=blue]
          > I will pretend that you have data as such:
          >
          > CustID Firstname Lastname Address City State ZIP
          > 1 Bo Brady 1 Street Somewhere XX 10001
          > 2 Hope Brady 1 Street Somewhere XX 10001
          > 3 Jack Deveraux 2 Road Somewhere XX 10002
          > 4 Jennifer Deveraux 2 Road Somewhere XX 10002
          > 5 Abe Carver 3 Ave. Somewhere XX 10003
          > 6 Lexie Carver 3 Ave. Somewhere XX 10003
          > 7 Tony Dimera 4 Lane Somewhere XX 10004
          > 8 Rex Dimera 5 Way Somewhere XX 10005
          > 9 Cassie Dimera 4 Lane Somewhere XX 10004
          > 10 Greta Von Amberg 6 Swamp Somewhere XX 10006
          >
          >
          >
          >
          > So, like, you want a bunch of files like:
          > 10001.csv, 10002.csv, etc.? Maybe something like this:
          >
          >
          >
          > <object runat="server" progid="Scripti ng.FileSystemOb ject"
          > id="oFSO"></object>
          > <%
          >
          > Dim oADO, oRS
          > Dim sOutput
          > Dim aZIPs, i, sZIP
          >
          > Const OUTPUT_PATH = "D:\Path\"
          >
          >
          > sSQL = "SELECT DISTINCT(ZIP) FROM Customers"
          > Set oADO = Server.CreateOb ject("ADODB.Con nection")
          > oADO.Open YourConnectionS tring
          > Set oRS = oADO.Execute(sS QL)
          > aZIPs = oRS.GetRows()
          > oRS.Close : Set oRS = Nothing
          >
          > For i = 0 To UBound(aZIPs, 2)
          > sZIP = aZIPs(0, i)
          > sSQL = "SELECT CustID,Firstnam e,Lastname,Addr ess,City,State, ZIP FROM
          > Customers WHERE ZIP='" & sZIP & "'"
          > Set oRS = oADO.Execute(sS QL)
          > sOutput = oRS.GetString(, ,",",vbCrLf)
          > oRS.Close : Set oRS = Nothing
          > oFSO.CreateText File(OUTPUT_PAT H & sZIP & ".csv", True).Write sOutput
          > Response.Write "<a href=""" & sZIP & ".csv"">Cli ck here to download[/color]
          CSV[color=blue]
          > for ZIP code " & sZIP & "</a><br>"
          > Next
          >
          > oADO.Close : Set oADO = Nothing
          > %>
          >
          >
          >
          > What that'll do is get all the zips, then loop through them all, query all
          > the data for each zip, and write a CSV from each resultset.
          >
          > Ray at home
          >
          >
          >
          >
          >
          > "atse" <dunggaze@yahoo .com> wrote in message
          > news:n8pfb.2075 24$Lnr1.50742@n ews01.bloor.is. net.cable.roger s.com...[color=green]
          > > Thanks Ray. I remember you have given me great helps before. Yes, I[/color][/color]
          really[color=blue][color=green]
          > > want to export a csv file.
          > > I have big csv files containing customers' contact info. I want to[/color][/color]
          export[color=blue][color=green]
          > > them by zip code and type to respective csv files. What is the simplest[/color]
          > way[color=green]
          > > to do that? Thanks again.
          > >
          > > Atse
          > >
          > >
          > > "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
          > > news:O6n1R2giDH A.1048@TK2MSFTN GP11.phx.gbl...[color=darkred]
          > > > There are a couple of things you can do.
          > > >
          > > > 1. Build your data in a table and add this to the top of your page:
          > > > <% Response.Conten tType = "applicatio n/vnd.ms-excel" %>
          > > >
          > > >
          > > > 2. Build yourself a comma delimited string and save the string to a[/color][/color]
          > file[color=green][color=darkred]
          > > > with a .csv file and link to it.
          > > >
          > > > 3. Use Office Web Components:
          > > > http://office.microsoft.com/downloads/2002/owc10.aspx. Before you'd[/color][/color][/color]
          go[color=blue][color=green]
          > > that[color=darkred]
          > > > route, read here though. http://support.microsoft.com/?id=317316
          > > >
          > > > If you need more details on 1 or 2, post back with a sample of your[/color][/color][/color]
          data[color=blue][color=green][color=darkred]
          > > > querying and what not.
          > > >
          > > > Ray at home
          > > >
          > > >
          > > > "atse" <dunggaze@yahoo .com> wrote in message
          > > > news:7Vnfb.2069 07$Lnr1.168685@ news01.bloor.is .net.cable.roge rs.com...
          > > > > Hi experts,
          > > > >
          > > > > I retrieve data from the database and display on ASP, then I export[/color]
          > > these[color=darkred]
          > > > > data to a file, like Excel (the best) or text file. Is it possible?[/color][/color][/color]
          I[color=blue][color=green][color=darkred]
          > > > think
          > > > > it is possible, but how can I do that? Thanks for any help.
          > > > >
          > > > > Atse
          > > > >
          > > > >
          > > >
          > > >[/color]
          > >
          > >[/color]
          >
          >[/color]


          Comment

          • Ray at

            #6
            Re: export data to Excel


            "atse" <dunggaze@yahoo .com> wrote in message
            news:Nhrfb.8669 $ko%.2833@news0 4.bloor.is.net. cable.rogers.co m...[color=blue]
            > Great! Ray.
            >
            > You know what I want!! Ok, what if retrieve from a .csv (e.g.[/color]
            customer.csv)[color=blue]
            > file, instead of the SQL db?[/color]

            8|
            You're storing your customer data in a text file? 8| 8| 8!
            I suppose you could use a text connection string and try that.
            All connection strings in one place. Find the syntax for your database connection using ADO.NET, ADO, ODBC, OLEDB, C#, VB, VB.NET, ASP.NET and more.



            [color=blue]
            > Further questions are:
            >
            > 1. I don't know how many groups of Zip (your example has group10001, group
            > 10002..group 10006. totally 6 groups), and I want to export 6 files, like
            > 10001.csv; ... 10006.csv which means the number of output file .csv would[/color]
            be[color=blue]
            > a variable.[/color]

            IN what I posted, that number is not known either. That is what the first
            query determines. (select count(distinct) zip...)


            [color=blue]
            >
            > 2. If there is no field name in a .csv file but column/comma/table or A,[/color]
            B,[color=blue]
            > C...X in an Excel file, how can I select them?[/color]

            What do you mean?

            [color=blue]
            >
            > 3. Actually I have another field name "language" (eng/fre), I want them to
            > be exported to files eng_10001.csv, eng_10002.csv, fre_10001.csv,
            > fre_10003.csv. Is it possible for me to do that. Of course, I am sure you
            > can.[/color]

            Yes, bring in that column and name your file
            rs.fields.item( "language").val ue & "_" & sZIP & ".csv."


            Ray at home


            Comment

            • atse

              #7
              Re: export data to Excel

              > > You know what I want!! Ok, what if retrieve from a .csv (e.g.[color=blue]
              > customer.csv)[color=green]
              > > file, instead of the SQL db?[/color]
              >
              > 8|
              > You're storing your customer data in a text file? 8| 8| 8!
              > I suppose you could use a text connection string and try that.
              > http://www.connectionstrings.com/
              >[/color]

              Yes, the data are mostly csv, dat or text format. Do I have to convert them
              to a unique format?
              [color=blue]
              >[color=green]
              > > Further questions are:
              > >
              > > 1. I don't know how many groups of Zip (your example has group10001,[/color][/color]
              group[color=blue][color=green]
              > > 10002..group 10006. totally 6 groups), and I want to export 6 files,[/color][/color]
              like[color=blue][color=green]
              > > 10001.csv; ... 10006.csv which means the number of output file .csv[/color][/color]
              would[color=blue]
              > be[color=green]
              > > a variable.[/color]
              >
              > IN what I posted, that number is not known either. That is what the first
              > query determines. (select count(distinct) zip...)
              >[color=green]
              > > 2. If there is no field name in a .csv file but column/comma/table or A,[/color]
              > B,[color=green]
              > > C...X in an Excel file, how can I select them?[/color]
              >
              > What do you mean?
              >[/color]

              I mean the data file doesn't have the field(column) name, but separated by
              comma or tab. If it is open with Excel, you will see column A, B...X. Then,
              how can I do the query string
              "select [something] from [what] where [what] = '"& sZIP & "' and [what] ='"&
              Lang&"'"

              Having exported a file on D:\path\eng_100 01.csv, how can I make it
              downloadable when the wwwroot is on C:\inetpub\

              Thanks,

              Atse


              Comment

              • Ray at

                #8
                Re: export data to Excel


                "atse" <dunggaze@yahoo .com> wrote in message
                news:3jEfb.2163 30$Lnr1.208183@ news01.bloor.is .net.cable.roge rs.com...[color=blue][color=green][color=darkred]
                > > > You know what I want!! Ok, what if retrieve from a .csv (e.g.[/color]
                > > customer.csv)[color=darkred]
                > > > file, instead of the SQL db?[/color]
                > >
                > > 8|
                > > You're storing your customer data in a text file? 8| 8| 8!
                > > I suppose you could use a text connection string and try that.
                > > http://www.connectionstrings.com/
                > >[/color]
                >
                > Yes, the data are mostly csv, dat or text format. Do I have to convert[/color]
                them[color=blue]
                > to a unique format?[/color]

                No, it's just a bit odd in my opinion that you wouldn't be using a
                database - Access at least.
                [color=blue]
                >[color=green]
                > >
                > >[color=darkred]
                > > > 2. If there is no field name in a .csv file but column/comma/table or[/color][/color][/color]
                A,[color=blue][color=green]
                > > B,[color=darkred]
                > > > C...X in an Excel file, how can I select them?[/color]
                > >
                > > What do you mean?
                > >[/color]
                >
                > I mean the data file doesn't have the field(column) name, but separated by
                > comma or tab. If it is open with Excel, you will see column A, B...X.[/color]
                Then,[color=blue]
                > how can I do the query string
                > "select [something] from [what] where [what] = '"& sZIP & "' and [what][/color]
                ='"&[color=blue]
                > Lang&"'"[/color]

                Is converting to a database an option here? Even if that's only 1% feasable
                for whatever reason, go with that 1%. Excel files, csv files, text files,
                etc. are all great for storing a little bit of data and using it for
                personal use, but driving a website off such data is going to lead to
                multiple headaches. Again, just my opinion! :]

                Ray at home


                Comment

                • atse

                  #9
                  Re: export data to Excel

                  > Is converting to a database an option here? Even if that's only 1%
                  feasible[color=blue]
                  > for whatever reason, go with that 1%. Excel files, csv files, text files,
                  > etc. are all great for storing a little bit of data and using it for
                  > personal use, but driving a website off such data is going to lead to
                  > multiple headaches. Again, just my opinion! :]
                  >
                  > Ray at home
                  >[/color]

                  Yes, I ever thought of this way, and I have to do that if no other choice.
                  The problem is about the format of the customer info in the .csv of .txt
                  files. For example, in the .csv file, sometimes the first column is the
                  title, the 2nd the last name... and totally there are 10 columns. But
                  another, there may be 9 or 11 columns and in the different column position.
                  How can I import the files to db? How can I know how many columns there are
                  in this file?
                  Thanks for any idea?

                  Atse

                  By the way, can you please show me the Excel connection string. I did try
                  one from http://www.connectionstrings.com/
                  but it somehow doesn't work. It complaint with below:

                  Microsoft JET Database Engine error '80040e37'

                  The Microsoft Jet database engine could not find the object 'xls'. Make sure
                  the object exists and that you spell its name and the path name correctly.

                  /list_item.asp, line 9



                  the connection is below:

                  con_xls="Provid er=Microsoft.Je t.OLEDB.4.0;Dat a Source=D:\'test .xls;Extended
                  Properties=""Ex cel 8.0;HDR=Yes;IME X=1"""
                  set conn=server.Cre ateObject("ADOD B.Connection")
                  conn.open(con_x ls)

                  'line 9 in list_item.asp

                  set rs = conn.execute ("select * from test.xls")




                  Comment

                  • Ray at

                    #10
                    Re: export data to Excel

                    You have an erroneous ' in your connection string there, right after D:\.

                    Ray at home

                    "atse" <dunggaze@yahoo .com> wrote in message
                    news:Ng2gb.3459 5$ko%.10728@new s04.bloor.is.ne t.cable.rogers. com...
                    [color=blue]
                    >
                    > Microsoft JET Database Engine error '80040e37'
                    >
                    > The Microsoft Jet database engine could not find the object 'xls'. Make[/color]
                    sure[color=blue]
                    > the object exists and that you spell its name and the path name correctly.
                    >
                    > /list_item.asp, line 9
                    >
                    >
                    >
                    > the connection is below:
                    >
                    > con_xls="Provid er=Microsoft.Je t.OLEDB.4.0;Dat a[/color]
                    Source=D:\'test .xls;Extended


                    Comment

                    • atse

                      #11
                      Re: export data to Excel

                      Sorry, I copy and paste by mistake only. It wouldn't be there in my file.
                      Any other problem? Thanks
                      Atse


                      "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
                      news:uPioMY7iDH A.2728@TK2MSFTN GP10.phx.gbl...[color=blue]
                      > You have an erroneous ' in your connection string there, right after D:\.
                      >
                      > Ray at home
                      >
                      > "atse" <dunggaze@yahoo .com> wrote in message
                      > news:Ng2gb.3459 5$ko%.10728@new s04.bloor.is.ne t.cable.rogers. com...
                      >[color=green]
                      > >
                      > > Microsoft JET Database Engine error '80040e37'
                      > >
                      > > The Microsoft Jet database engine could not find the object 'xls'. Make[/color]
                      > sure[color=green]
                      > > the object exists and that you spell its name and the path name[/color][/color]
                      correctly.[color=blue][color=green]
                      > >
                      > > /list_item.asp, line 9
                      > >
                      > >
                      > >
                      > > the connection is below:
                      > >
                      > > con_xls="Provid er=Microsoft.Je t.OLEDB.4.0;Dat a[/color]
                      > Source=D:\'test .xls;Extended
                      >
                      >[/color]


                      Comment

                      • Ray at

                        #12
                        Re: export data to Excel

                        IIRC, you were using a "file" variable in your querystring. And I assume
                        that was used in building your connection string. So, it sounds to me that
                        the variable was empty.

                        Response.Write YourConnectionS tringVariable
                        Response.End

                        Ray at home

                        "atse" <dunggaze@yahoo .com> wrote in message
                        news:wh5gb.2349 12$Lnr1.219498@ news01.bloor.is .net.cable.roge rs.com...[color=blue]
                        > Sorry, I copy and paste by mistake only. It wouldn't be there in my file.
                        > Any other problem? Thanks
                        > Atse
                        >
                        >
                        > "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
                        > news:uPioMY7iDH A.2728@TK2MSFTN GP10.phx.gbl...[color=green]
                        > > You have an erroneous ' in your connection string there, right after[/color][/color]
                        D:\.[color=blue][color=green]
                        > >
                        > > Ray at home
                        > >
                        > > "atse" <dunggaze@yahoo .com> wrote in message
                        > > news:Ng2gb.3459 5$ko%.10728@new s04.bloor.is.ne t.cable.rogers. com...
                        > >[color=darkred]
                        > > >
                        > > > Microsoft JET Database Engine error '80040e37'
                        > > >
                        > > > The Microsoft Jet database engine could not find the object 'xls'.[/color][/color][/color]
                        Make[color=blue][color=green]
                        > > sure[color=darkred]
                        > > > the object exists and that you spell its name and the path name[/color][/color]
                        > correctly.[color=green][color=darkred]
                        > > >
                        > > > /list_item.asp, line 9
                        > > >
                        > > >
                        > > >
                        > > > the connection is below:
                        > > >
                        > > > con_xls="Provid er=Microsoft.Je t.OLEDB.4.0;Dat a[/color]
                        > > Source=D:\'test .xls;Extended
                        > >
                        > >[/color]
                        >
                        >[/color]


                        Comment

                        • atse

                          #13
                          Re: export data to Excel

                          I did try that too. It displays a correct string.

                          "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
                          news:uw4DBs7iDH A.3056@tk2msftn gp13.phx.gbl...[color=blue]
                          > IIRC, you were using a "file" variable in your querystring. And I assume
                          > that was used in building your connection string. So, it sounds to me[/color]
                          that[color=blue]
                          > the variable was empty.
                          >
                          > Response.Write YourConnectionS tringVariable
                          > Response.End
                          >
                          > Ray at home
                          >
                          > "atse" <dunggaze@yahoo .com> wrote in message
                          > news:wh5gb.2349 12$Lnr1.219498@ news01.bloor.is .net.cable.roge rs.com...[color=green]
                          > > Sorry, I copy and paste by mistake only. It wouldn't be there in my[/color][/color]
                          file.[color=blue][color=green]
                          > > Any other problem? Thanks
                          > > Atse
                          > >
                          > >
                          > > "Ray at <%=sLocation% >" <myfirstname at lane 34 . komm> wrote in message
                          > > news:uPioMY7iDH A.2728@TK2MSFTN GP10.phx.gbl...[color=darkred]
                          > > > You have an erroneous ' in your connection string there, right after[/color][/color]
                          > D:\.[color=green][color=darkred]
                          > > >
                          > > > Ray at home
                          > > >
                          > > > "atse" <dunggaze@yahoo .com> wrote in message
                          > > > news:Ng2gb.3459 5$ko%.10728@new s04.bloor.is.ne t.cable.rogers. com...
                          > > >
                          > > > >
                          > > > > Microsoft JET Database Engine error '80040e37'
                          > > > >
                          > > > > The Microsoft Jet database engine could not find the object 'xls'.[/color][/color]
                          > Make[color=green][color=darkred]
                          > > > sure
                          > > > > the object exists and that you spell its name and the path name[/color]
                          > > correctly.[color=darkred]
                          > > > >
                          > > > > /list_item.asp, line 9
                          > > > >
                          > > > >
                          > > > >
                          > > > > the connection is below:
                          > > > >
                          > > > > con_xls="Provid er=Microsoft.Je t.OLEDB.4.0;Dat a
                          > > > Source=D:\'test .xls;Extended
                          > > >
                          > > >[/color]
                          > >
                          > >[/color]
                          >
                          >[/color]


                          Comment

                          • Greg Griffiths

                            #14
                            Re: export data to Excel

                            also worth checking out http://www.greggriffiths.org/webdev/both/excel/

                            atse wrote:
                            [color=blue]
                            > Hi experts,
                            >
                            > I retrieve data from the database and display on ASP, then I export these
                            > data to a file, like Excel (the best) or text file. Is it possible? I think
                            > it is possible, but how can I do that? Thanks for any help.
                            >
                            > Atse[/color]

                            Comment

                            • Chris Baldwin

                              #15
                              Re: export data to Excel

                              "atse" <dunggaze@yahoo .com> wrote in message news:<7Vnfb.206 907$Lnr1.168685 @news01.bloor.i s.net.cable.rog ers.com>...[color=blue]
                              > Hi experts,
                              >
                              > I retrieve data from the database and display on ASP, then I export these
                              > data to a file, like Excel (the best) or text file. Is it possible? I think
                              > it is possible, but how can I do that? Thanks for any help.
                              >
                              > Atse[/color]

                              Atse,

                              SoftArtisans ExcelWriter can do exactly that... database-to-Excel web
                              reports, and you don't need to have Excel installed on the web server.



                              -chris

                              Comment

                              Working...