MODIFIED SOURCE CODE FOR NEWATTCH.FRM
Made on Tuesday, Apr 8, 2003 at 9:43 AM
Option Explicit
'>>>>>>>>>>>>>>>>>>>>>>>>
'ResMe Converted To A Property: Const FORMCAPTION = "New Attached Table"
'ResMe Converted To A Property: Const BUTTON1 = "&Attach"
'ResMe Converted To A Property: Const BUTTON2 = "&Cancel"
'ResMe Converted To A Property: Const Label1 = "Attachment &Name:"
'ResMe Converted To A Property: Const Label2 = "&Database Name:"
'ResMe Converted To A Property: Const LABEL3 = "C&onnect String:"
'ResMe Converted To A Property: Const LABEL4 = "&Table to Attach:"
'ResMe Converted To A Property: Const CHECK1 = "AttachSave&PWD"
'ResMe Converted To A Property: Const CHECK2 = "Attach&Exclusive"
'>>>>>>>>>>>>>>>>>>>>>>>>
Dim mbAdded As Boolean
Private Sub cmdCancel_Click()
If mbAdded Then
'they added some so we need to refresh the table list
RefreshTables Nothing
End If
Unload Me
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF1 And Shift = 0 Then
DisplayTopic 2016135
End If
End Sub
Sub Form_Load()
'ResMe autogenerated line of code to call the initialization routine that was automatically generated.
Call frmNewAttach_Auto_Init
Me.Caption = FORMCAPTION
cmdAttach.Caption = BUTTON1
cmdCancel.Caption = BUTTON2
lblLabels(0).Caption = Label1
lblLabels(1).Caption = Label2
lblLabels(2).Caption = LABEL3
lblLabels(3).Caption = LABEL4
chkSavePassword.Caption = CHECK1
chkExclusive.Caption = CHECK2
'WAS: cboConnect.AddItem "Access MDB"
cboConnect.AddItem LoadResString(S32_Access_MDB)
'WAS: cboConnect.AddItem "Dbase III"
cboConnect.AddItem LoadResString(S151_Dbase_III)
'WAS: cboConnect.AddItem "Dbase IV"
cboConnect.AddItem LoadResString(S153_Dbase_IV)
'WAS: cboConnect.AddItem "FoxPro 2.0"
cboConnect.AddItem LoadResString(S262_FoxPro_2_0)
'WAS: cboConnect.AddItem "FoxPro 2.5"
cboConnect.AddItem LoadResString(S264_FoxPro_2_5)
'WAS: cboConnect.AddItem "FoxPro 2.6"
cboConnect.AddItem LoadResString(S266_FoxPro_2_6)
'WAS: cboConnect.AddItem "Paradox 3.X"
cboConnect.AddItem LoadResString(S398_Paradox_3_X)
'WAS: cboConnect.AddItem "Paradox 4.X"
cboConnect.AddItem LoadResString(S400_Paradox_4_X)
'WAS: cboConnect.AddItem "Excel 5.0"
cboConnect.AddItem LoadResString(S216_Excel_5_0)
'WAS: cboConnect.AddItem "Excel 4.0"
cboConnect.AddItem LoadResString(S214_Excel_4_0)
'WAS: cboConnect.AddItem "Excel 3.0"
cboConnect.AddItem LoadResString(S212_Excel_3_0)
'WAS: cboConnect.AddItem "Text Files"
cboConnect.AddItem LoadResString(S539_Text_Files)
cboConnect.AddItem "ODBC"
cboConnect.ListIndex = 0
End Sub
Private Sub txtAttachName_Change()
cmdAttach.Enabled = Len(txtAttachName.Text) > 0
If cboTableName.ListCount > 0 Then cboTableName.Clear
End Sub
Private Sub cboConnect_Change()
cmdAttach.Enabled = Len(txtAttachName.Text) > 0
If cboTableName.ListCount > 0 Then cboTableName.Clear
End Sub
Private Sub cboTableName_DropDown()
Dim db As Database
Dim i As Integer
Dim sDataType As String 'data type string
Dim tdf As TableDef
On Error GoTo DDErr
Screen.MousePointer = vbHourglass
If cboTableName.ListCount = 0 Then
'fill in the list
sDataType = GetConnectStr()
If cboConnect.ListIndex = 0 Then
'special case for Microsoft Access mdb tables
Set db = gwsMainWS.OpenDatabase(vbNullString, 0, 0, sDataType)
Else
Set db = gwsMainWS.OpenDatabase(vbNullString, 0, 0, sDataType & ";" & cboConnect.Text)
End If
For Each tdf In db.TableDefs
If (tdf.Attributes And dbSystemObject) = 0 Then
cboTableName.AddItem tdf.Name
End If
Next
End If
Screen.MousePointer = vbDefault
Exit Sub
DDErr:
ShowError
End Sub
Private Sub cmdAttach_Click()
frmAttachments.AddAttachment
mbAdded = True
End Sub
Public Function GetConnectStr() As String
On Error GoTo GCErr
Dim sTmp As String
If cboConnect.ListIndex = 0 Then
sTmp = ";"
Else
sTmp = cboConnect.Text & ";"
End If
If Len(txtDatabase.Text) > 0 Then
'WAS: sTmp = sTmp & "database=" & txtDatabase
sTmp = sTmp & LoadResString(S147_database) & txtDatabase
End If
GetConnectStr = sTmp
Exit Function
GCErr:
ShowError
End Function
'*********************************************************************************
'** This Section Of Code Was Automatically Generated By ResMe **
'** **
'** String assignments to Constants have been converted to read-only properties **
'*********************************************************************************
'This was: Const FORMCAPTION = "New Attached Table"
Property Get FORMCAPTION As String
'WAS: FORMCAPTION = "New Attached Table"
FORMCAPTION = LoadResString(S333_New_Attached_Table)
End Property
'This was: Const BUTTON1 = "&Attach"
Property Get BUTTON1 As String
'WAS: BUTTON1 = "&Attach"
BUTTON1 = LoadResString(S53_Attach)
End Property
'This was: Const BUTTON2 = "&Cancel"
Property Get BUTTON2 As String
'WAS: BUTTON2 = "&Cancel"
BUTTON2 = LoadResString(S84_Cancel)
End Property
'This was: Const Label1 = "Attachment &Name:"
Property Get Label1 As String
'WAS: Label1 = "Attachment &Name:"
Label1 = LoadResString(S57_Attachment_Name)
End Property
'This was: Const Label2 = "&Database Name:"
Property Get Label2 As String
'WAS: Label2 = "&Database Name:"
Label2 = LoadResString(S141_Database_Name)
End Property
'This was: Const LABEL3 = "C&onnect String:"
Property Get LABEL3 As String
'WAS: LABEL3 = "C&onnect String:"
LABEL3 = LoadResString(S105_C_onnect_String)
End Property
'This was: Const LABEL4 = "&Table to Attach:"
Property Get LABEL4 As String
'WAS: LABEL4 = "&Table to Attach:"
LABEL4 = LoadResString(S523_Table_to_Attach)
End Property
'This was: Const CHECK1 = "AttachSave&PWD"
Property Get CHECK1 As String
'WAS: CHECK1 = "AttachSave&PWD"
CHECK1 = LoadResString(S61_AttachSave_PWD)
End Property
'This was: Const CHECK2 = "Attach&Exclusive"
Property Get CHECK2 As String
'WAS: CHECK2 = "Attach&Exclusive"
CHECK2 = LoadResString(S54_Attach_Exclusive)
End Property
Private Sub frmNewAttach_Auto_Init()
'This routine initializes all User Interface control properties on frmNewAttach.
'This section of code was automatically generated by the ResMe String Extraction Utility.
'WAS: Me.Caption = "New Attachment"
Me.Caption = LoadResString(S334_New_Attachment)
'WAS: chkExclusive.Caption = "AttachExclusive"
chkExclusive.Caption = LoadResString(S55_AttachExclusive)
'WAS: chkSavePassword.Caption = "AttachSavePWD"
chkSavePassword.Caption = LoadResString(S62_AttachSavePWD)
'WAS: cmdCancel.Caption = "&Cancel"
cmdCancel.Caption = LoadResString(S84_Cancel)
'WAS: cmdAttach.Caption = "&Attach"
cmdAttach.Caption = LoadResString(S53_Attach)
'WAS: lblLabels(1).Caption = "Database Name: "
lblLabels(1).Caption = LoadResString(S142_Database_Name)
'WAS: lblLabels(3).Caption = "Table to Attach: "
lblLabels(3).Caption = LoadResString(S524_Table_to_Attach)
'WAS: lblLabels(2).Caption = "Connect String: "
lblLabels(2).Caption = LoadResString(S106_Connect_String)
'WAS: lblLabels(0).Caption = "Attachment Name: "
lblLabels(0).Caption = LoadResString(S58_Attachment_Name)
End Sub