Click here to Skip to main content
Licence CPOL
First Posted 24 Jan 2008
Views 15,090
Downloads 95
Bookmarked 27 times

Table Data Exporter

By | 24 Jan 2008 | Article
The Table Data Exporter creates a SQL script for data in a table.
 
Part of The SQL Zone sponsored by
See Also

ExportTable

Introduction

This application will let you script table data into a file. It will create an INSERT statement for each row in your table.

Using the code

The application is written in Visual Studio 2003, and has been tested with SQL Server only. Potentially, the application can work with other databases.

The application uses the DataLink object to connect to the database:

Protected Function EditConnectionString(ByVal sConnectionString As String)
    Try
        Dim oDataLinks As Object = CreateObject("DataLinks")
        Dim cn As Object = CreateObject("ADODB.Connection")
        cn.ConnectionString = sConnectionString
        oDataLinks.hWnd = Me.Handle

        If Not oDataLinks.PromptEdit(cn) Then
            'User pressed cancel button
            Return ""
        End If

        cn.Open()
        Return cn.ConnectionString
    Catch ex As Exception
        MsgBox(ex.Message)
        Return ""
    End Try
End Function

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Igor Krupitsky

Web Developer

United States United States

Member

Igor is a business intelligence consultant working in Tampa, Florida. He has a BS in Finance from University of South Carolina and Masters in Information Management System from University of South Florida. He also has following professional certifications: MCSD, MCDBA, MCAD.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionHow to disable the provider PinmemberBenosn Tan16:31 29 Jan '08  
Hi,
 
Thank you very much for this sample. Can you please let me know how to disable the provider page in datalink properties? I tried to do that in C#, but do not have any luck to make it right. Thanks.
 
Best regards,
Benson
AnswerRe: How to disable the provider PinmemberIgor Krupitsky12:03 31 Jan '08  
GeneralWorked great for me with SQL 2000 PinmemberG James14:05 28 Jan '08  
GeneralRe: Worked great for me with SQL 2000 PinmemberJosh Blair11:29 29 Jan '08  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120529.1 | Last Updated 24 Jan 2008
Article Copyright 2008 by Igor Krupitsky
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid