How do I export a datatable to a .dbf file?-VBForums
Results 1 to 2 of 2

Thread: How do I export a datatable to a .dbf file?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2016
    Posts
    66

    How do I export a datatable to a .dbf file?

    I have a datatable that I want to export to a .dbf file type. Everything I've found on the internet has not been helpful at all

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Sep 2016
    Posts
    66

    Re: How do I export a datatable to a .dbf file?

    Figured it out, this is my code:

    Code:
    Dim dBaseConnection As New System.Data.OleDb.OleDbConnection(“Provider=Microsoft.Jet.OLEDB.4.0;” & “Data Source=” & path & “;” & “Extended Properties=dBase IV”)
    
                dBaseConnection.Open()
    
                'New table
                Dim SQLCreateCommand As String
                'SQLCreateCommand = “CREATE TABLE NewTable ” & “(subdir TEXT(50))”
                Dim NewString As String = dt.ToString
                SQLCreateCommand = "SELECT * INTO NewTable From " & TableName
                Dim dBaseCommand As New System.Data.OleDb.OleDbCommand(SQLCreateCommand, dBaseConnection)
    
                dBaseCommand.ExecuteNonQuery()
                dBaseConnection.Close()

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.