MODIFIED 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
'WAS: MsgBox (StripConnect(lstTables.List(i))) & ": " & MSG3, vbInformation, Me.Caption
MsgBox (StripConnect(lstTables.List(i))) & LoadResString(S29_) & MSG3, vbInformation, Me.Caption
End If
End If
Screen.MousePointer = vbDefault
'WAS: MsgBox (StripConnect(lstTables.List(i))) & ": " & MSG4, vbInformation, Me.Caption
MsgBox (StripConnect(lstTables.List(i))) & LoadResString(S29_) & MSG4, vbInformation, Me.Caption
lstTables.Selected(i) = False
Else
Screen.MousePointer = vbDefault
Beep
'WAS: MsgBox (StripConnect(lstTables.List(i))) & ": " & MSG3, vbInformation, Me.Caption
MsgBox (StripConnect(lstTables.List(i))) & LoadResString(S29_) & 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
'WAS: FORMCAPTION = "Copy Structure"
FORMCAPTION = LoadResString(S117_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
'WAS: BUTTON2 = "&Close"
BUTTON2 = LoadResString(S94_Close)
End Property
'This was: Const LABEL0 = "Tables:"
Property Get LABEL0 As String
'WAS: LABEL0 = "Tables:"
LABEL0 = LoadResString(S532_Tables)
End Property
'This was: Const Label1 = "Target Database:"
Property Get Label1 As String
'WAS: Label1 = "Target Database:"
Label1 = LoadResString(S537_Target_Database)
End Property
'This was: Const Label2 = "Target Connect String:"
Property Get Label2 As String
'WAS: Label2 = "Target Connect String:"
Label2 = LoadResString(S535_Target_Connect_Stri)
End Property
'This was: Const LABEL3 = "(Note: Export is Faster)"
Property Get LABEL3 As String
'WAS: LABEL3 = "(Note: Export is Faster)"
LABEL3 = LoadResString(S8_Note_Export_is_Fast)
End Property
'This was: Const CHKBOX1 = "Copy Indexes"
Property Get CHKBOX1 As String
'WAS: CHKBOX1 = "Copy Indexes"
CHKBOX1 = LoadResString(S114_Copy_Indexes)
End Property
'This was: Const CHKBOX2 = "Copy Data"
Property Get CHKBOX2 As String
'WAS: CHKBOX2 = "Copy Data"
CHKBOX2 = LoadResString(S112_Copy_Data)
End Property
'This was: Const MSG1 = "Copying Table(s)"
Property Get MSG1 As String
'WAS: MSG1 = "Copying Table(s)"
MSG1 = LoadResString(S119_Copying_Table_s)
End Property
'This was: Const MSG2 = "Enter New Table Name:"
Property Get MSG2 As String
'WAS: MSG2 = "Enter New Table Name:"
MSG2 = LoadResString(S197_Enter_New_Table_Nam)
End Property
'This was: Const MSG3 = "Copy of Data was Unsuccessful!"
Property Get MSG3 As String
'WAS: MSG3 = "Copy of Data was Unsuccessful!"
MSG3 = LoadResString(S115_Copy_of_Data_was_Un)
End Property
'This was: Const MSG4 = "Copy of Structure was Successful!"
Property Get MSG4 As String
'WAS: MSG4 = "Copy of Structure was Successful!"
MSG4 = LoadResString(S116_Copy_of_Structure_w)
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.
'WAS: Me.Caption = "Copy Structure"
Me.Caption = LoadResString(S117_Copy_Structure)
'WAS: chkCopyData.Caption = "Copy Data "
chkCopyData.Caption = LoadResString(S113_Copy_Data)
'WAS: cmdClose.Caption = "&Close"
cmdClose.Caption = LoadResString(S94_Close)
'WAS: cmdOK.Caption = "&OK"
cmdOK.Caption = LoadResString(S355_OK)
'WAS: chkCopyIndexes.Caption = "Copy Indexes"
chkCopyIndexes.Caption = LoadResString(S114_Copy_Indexes)
'WAS: lblLabels(3).Caption = "(Note:Export is Faster)"
lblLabels(3).Caption = LoadResString(S9_Note_Export_is_Fast)
'WAS: lblLabels(2).Caption = " Target Connect String: "
lblLabels(2).Caption = LoadResString(S534_Target_Connect_Stri)
'WAS: lblLabels(1).Caption = " Target Database: "
lblLabels(1).Caption = LoadResString(S536_Target_Database)
'WAS: lblLabels(0).Caption = " Tables: "
lblLabels(0).Caption = LoadResString(S531_Tables)
End Sub