Click here to Skip to main content
5,788,961 members and growing! (21,007 online)
Email Password   helpLost your password?
Database » Database » SQL Server License: The Code Project Open License (CPOL)

Table Data Exporter

By Igor Krupitsky

Table Data Exporter creates an SQL script for data in a table.
VB (VB 7.x, VB 8.0, VB 9.0, VB 6, VB)

Posted: 24 Jan 2008
Updated: 24 Jan 2008
Views: 5,459
Bookmarked: 14 times
Note: This is an unedited reader contribution
Announcements
Loading...



Search    
Advanced Search
Sitemap
5 votes for this Article.
Popularity: 3.17 Rating: 4.53 out of 5
1 vote, 20.0%
1
0 votes, 0.0%
2
0 votes, 0.0%
3
1 vote, 20.0%
4
3 votes, 60.0%
5
Note: This is an unedited contribution. If this article is inappropriate, needs attention or copies someone else's work without reference then please Report This Article
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 is using 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


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.
Occupation: Web Developer
Location: United States United States

Other popular Database articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 4 of 4 (Total in Forum: 4) (Refresh)FirstPrevNext
GeneralHow to disable the providermemberBenosn Tan17:31 29 Jan '08  
QuestionRe: How to disable the providermemberIgor Krupitsky13:03 31 Jan '08  
GeneralWorked great for me with SQL 2000memberG James15:05 28 Jan '08  
GeneralRe: Worked great for me with SQL 2000memberJosh Blair12:29 29 Jan '08  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 24 Jan 2008
Editor:
Copyright 2008 by Igor Krupitsky
Everything else Copyright © CodeProject, 1999-2009
Web11 | Advertise on the Code Project