Excel 2003 coonection by vb 6

  • Dim con_exl As System.Data.OleDb.OleDbConnection

    con_exl = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;" & _

    "data source=C:\test.xls;Extended Properties=Excel 8.0;")

    Dim testAdapter As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter()

    testAdapter.TableMappings.Add("Table", "test")

    con_exl.Open()

    Dim testCommand As OleDb.OleDbCommand = New OleDb.OleDbCommand( _

    "SELECT * FROM [test$];", con_exl)

    testCommand.CommandType = CommandType.Text

    test.SelectCommand = testCommand

    Dim testDataSet As DataSet = New DataSet("test")

    testAdapter.Fill(testDataSet)

    DataGrid1.SetDataBinding(testDataSet, "test")

  • 1. Do you have a question about the code?

    a. Does the code when executed fail and return an error?

    2. Does your code perform properly and you want to make it available to others?

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • The codes perform properly

    But I don't have links to the source of codes .

    In the architecture this situation is usually called eclectic.

    Took something, but something forgotten .Today worked. Tomorrow might not work.

  • setiv (5/23/2011)


    The codes perform properly

    But I don't have links to the source of codes .

    In the architecture this situation is usually called eclectic.

    Took something, but something forgotten .Today worked. Tomorrow might not work.

    What do you mean you don't have links to the source code(s)?

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • This is the starting point for not only my possible developments

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply