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
Return ""
End If
cn.Open()
Return cn.ConnectionString
Catch ex As Exception
MsgBox(ex.Message)
Return ""
End Try
End Function