ORIGINAL SOURCE CODE FOR CPYSTRU.FRM
Made on Tuesday, Apr 8, 2003 at 9:43 AM
Option Explicit
'>>>>>>>>>>>>>>>>>>>>>>>>
'ResMe Converted To A Property: Const FORMCAPTION = "Copy Structure"
'ResMe Converted To A Property: Const BUTTON1 = "&OK"
'ResMe Converted To A Property: Const BUTTON2 = "&Close"
'ResMe Converted To A Property: Const LABEL0 = "Tables:"
'ResMe Converted To A Property: Const Label1 = "Target Database:"
'ResMe Converted To A Property: Const Label2 = "Target Connect String:"
'ResMe Converted To A Property: Const LABEL3 = "(Note: Export is Faster)"
'ResMe Converted To A Property: Const CHKBOX1 = "Copy Indexes"
'ResMe Converted To A Property: Const CHKBOX2 = "Copy Data"
'ResMe Converted To A Property: Const MSG1 = "Copying Table(s)"
'ResMe Converted To A Property: Const MSG2 = "Enter New Table Name:"
'ResMe Converted To A Property: Const MSG3 = "Copy of Data was Unsuccessful!"
'ResMe Converted To A Property: Const MSG4 = "Copy of Structure was Successful!"
'>>>>>>>>>>>>>>>>>>>>>>>>
Private Sub cmdClose_Click()
RefreshTables Nothing 'just in case some were added
Unload Me
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF1 And Shift = 0 Then
DisplayTopic 2016121
End If
End Sub
Private Sub Form_Load()
'ResMe autogenerated line of code to call the initialization routine that was automatically generated.
Call frmCopyStruct_Auto_Init
Dim i As Integer
Me.Caption = FORMCAPTION
cmdOK.Caption = BUTTON1
cmdClose.Caption = BUTTON2
lblLabels(0).Caption = LABEL0
lblLabels(1).Caption = Label1
lblLabels(2).Caption = Label2
lblLabels(3).Caption = LABEL3
chkCopyIndexes.Caption = CHKBOX1
chkCopyData.Caption = CHKBOX2
RefreshTables lstTables
txtDatabase.Text = gsDBName
txtConnect.Text = gdbCurrentDB.Connect
'select the table that was selected on the database form
For i = 0 To lstTables.ListCount - 1
If lstTables.List(i) = gnodDBNode.Text Then
lstTables.Selected(i) = True
Exit For
End If
Next
End Sub
Private Sub cmdOK_Click()
Dim i As Integer
Dim bDifferentDB As Integer
Dim sToName As String
Dim dbToDatabase As Database
On Error GoTo OkayErr
MsgBar MSG1, True
Screen.MousePointer = vbHourglass
If Len(txtDatabase.Text) = 0 Or txtDatabase.Text = gsDBName Then
Set dbToDatabase = gdbCurrentDB
bDifferentDB = False
Else
Set dbToDatabase = gwsMainWS.OpenDatabase(txtDatabase.Text, False, False, txtConnect.Text)
dbToDatabase.QueryTimeout = glQueryTimeout
bDifferentDB = True
End If
For i = 0 To lstTables.ListCount - 1
If lstTables.Selected(i) Then
If bDifferentDB = False Then
sToName = InputBox(MSG2)
If Len(sToName) = 0 Then GoTo SkipIt
Else
sToName = (StripConnect(lstTables.List(i)))
End If
Else
GoTo SkipIt
End If
Screen.MousePointer = vbHourglass
If CopyStruct(gdbCurrentDB, dbToDatabase, (StripConnect(lstTables.List(i))), sToName, (chkCopyIndexes)) Then
If chkCopyData = 1 Then
If CopyData(gdbCurrentDB, dbToDatabase, (StripConnect(lstTables.List(i))), sToName) = False Then
Beep
MsgBox (StripConnect(lstTables.List(i))) & ": " & MSG3, vbInformation, Me.Caption
End If
End If
Screen.MousePointer = vbDefault
MsgBox (StripConnect(lstTables.List(i))) & ": " & MSG4, vbInformation, Me.Caption
lstTables.Selected(i) = False
Else
Screen.MousePointer = vbDefault
Beep
MsgBox (StripConnect(lstTables.List(i))) & ": " & MSG3, vbInformation, Me.Caption
End If
SkipIt:
Next
MsgBar vbNullString, False
Exit Sub
OkayErr:
ShowError
End Sub
'*********************************************************************************
'** This Section Of Code Was Automatically Generated By ResMe **
'** **
'** String assignments to Constants have been converted to read-only properties **
'*********************************************************************************
'This was: Const FORMCAPTION = "Copy Structure"
Property Get FORMCAPTION As String
FORMCAPTION = "Copy Structure"
End Property
'This was: Const BUTTON1 = "&OK"
Property Get BUTTON1 As String
BUTTON1 = "&OK"
End Property
'This was: Const BUTTON2 = "&Close"
Property Get BUTTON2 As String
BUTTON2 = "&Close"
End Property
'This was: Const LABEL0 = "Tables:"
Property Get LABEL0 As String
LABEL0 = "Tables:"
End Property
'This was: Const Label1 = "Target Database:"
Property Get Label1 As String
Label1 = "Target Database:"
End Property
'This was: Const Label2 = "Target Connect String:"
Property Get Label2 As String
Label2 = "Target Connect String:"
End Property
'This was: Const LABEL3 = "(Note: Export is Faster)"
Property Get LABEL3 As String
LABEL3 = "(Note: Export is Faster)"
End Property
'This was: Const CHKBOX1 = "Copy Indexes"
Property Get CHKBOX1 As String
CHKBOX1 = "Copy Indexes"
End Property
'This was: Const CHKBOX2 = "Copy Data"
Property Get CHKBOX2 As String
CHKBOX2 = "Copy Data"
End Property
'This was: Const MSG1 = "Copying Table(s)"
Property Get MSG1 As String
MSG1 = "Copying Table(s)"
End Property
'This was: Const MSG2 = "Enter New Table Name:"
Property Get MSG2 As String
MSG2 = "Enter New Table Name:"
End Property
'This was: Const MSG3 = "Copy of Data was Unsuccessful!"
Property Get MSG3 As String
MSG3 = "Copy of Data was Unsuccessful!"
End Property
'This was: Const MSG4 = "Copy of Structure was Successful!"
Property Get MSG4 As String
MSG4 = "Copy of Structure was Successful!"
End Property
Private Sub frmCopyStruct_Auto_Init()
'This routine initializes all User Interface control properties on frmCopyStruct.
'This section of code was automatically generated by the ResMe String Extraction Utility.
Me.Caption = "Copy Structure"
chkCopyData.Caption = "Copy Data "
cmdClose.Caption = "&Close"
cmdOK.Caption = "&OK"
chkCopyIndexes.Caption = "Copy Indexes"
lblLabels(3).Caption = "(Note:Export is Faster)"
lblLabels(2).Caption = " Target Connect String: "
lblLabels(1).Caption = " Target Database: "
lblLabels(0).Caption = " Tables: "
End Sub