'The following code is generated by Data Pump Designer
Sub Main()
'References DataPump (Description: DataPump _
object for transferring data between any OLEDB _
Sources)
Dim myDataPump as DataPump.Engine
Dim sError As String
Dim sMsg As String
Dim sRepositoryConnectionString As String
Dim sJobTableName as String
Dim sJobName as String
Dim bBCP as Boolean
Dim sReplace() as String
On Error Goto ErrHandler
sRepositoryConnectionString = "Provider=SQLOLEDB; _
Server=dev1;UID=hao;PWD=madonna;Database=pubs"
sJobTableName = "tJobInfo"
sJobName = "VBPJ Example"
bBCP = True
Set myDataPump = New DataPump.Engine
ReDim sReplace(1 to 2)
sReplace(1) = "[Start Date]?3/1/1999"
sReplace(2) = "[End Date]?3/31/1999"
With myDataPump
.sRepositoryConnectionString = _
sRepositoryConnectionString
.sJobTableName = sJobTableName
.sJobName = sJobName
.vReplace = sReplace
.LoadTable(bBCP)
End With
sMsg = "Load job '" & sJobName & "' was & _
"successful."
sMsg = sMsg & vbCrlf & MyDataPump. _
lNoOfRowsLoaded & " rows loaded."
Set myDataPump = Nothing
MsgBox sMsg
Exit Sub
ErrHandler:
sError = "Error Source: " & Err.Source & vbCrLf
sError = sError & "Error Number: " & Err.Number & _
vbCrLf
sError = sError & "Error Description: " & _
Err.Description & vbCrLf
MsgBox sError$
If Not (myDataPump Is Nothing) Then
Set myDataPump = Nothing
End If
End Sub
|