Question : help: how to use dao to update excel file?

dear experts,

i am trying to develop a test vb.net console application to be able to update excel file content. everytime, the update() method is called, i got "cannot update. database or object is read-only".

your advice would be highly appreciated.

thanks
ps. below is my code:
---
Module Module1

    ' this sample code attempts to open excel file for update
    Sub Main()

        Dim Filename As String = "c:\xls\score.xls"
        'for the spreadsheet database
        Dim db As DAO.Database
        Dim rs As DAO.Recordset

        Dim dbEngine As New DAO.DBEngine()
        'open the excell file
        db = dbEngine.OpenDatabase(Filename, False, False, "Excel 5.0;HDR=no;IMEX=1;")
        'dbEngine.open()
        rs = db.OpenRecordset(db.TableDefs(0).Name)  'Open first Sheet

        rs.MoveFirst()

        While Not rs.EOF()
            ' The Excel file with Columns
            ' Column A = Fields(0)
            ' Column B = Fields(1)

            rs.Edit()

            ' update the first column with hello text
            rs.Fields(0).Value = "hello"

            rs.Update()

            ' output the updated content to the concole
            Console.WriteLine(rs.Fields(0).Value)

            rs.MoveNext() 'Read next Row

        End While

        ' close spreadsheet
        rs.Close()
        rs = Nothing

    End Sub

End Module

Answer : help: how to use dao to update excel file?

Try to create a msi project for your web project then add all these files to that project then you can make a copy of that project and install that msi file on to other machine and should be ready to go. Below I am adding a link which may help you.

http://www.dreamincode.net/forums/topic/77368-create-msi-for-project-created-in-microsoft-visual-studio-08/
http://appdeveloper.intel.com/en-us/blog/2009/12/17/creating-your-msi-installer-using-visual-studio-2008
Random Solutions  
 
programming4us programming4us