ORIGINAL 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
cboConnect.AddItem "Access MDB"
cboConnect.AddItem "Dbase III"
cboConnect.AddItem "Dbase IV"
cboConnect.AddItem "FoxPro 2.0"
cboConnect.AddItem "FoxPro 2.5"
cboConnect.AddItem "FoxPro 2.6"
cboConnect.AddItem "Paradox 3.X"
cboConnect.AddItem "Paradox 4.X"
cboConnect.AddItem "Excel 5.0"
cboConnect.AddItem "Excel 4.0"
cboConnect.AddItem "Excel 3.0"
cboConnect.AddItem "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
sTmp = sTmp & "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
FORMCAPTION = "New Attached Table"
End Property
'This was: Const BUTTON1 = "&Attach"
Property Get BUTTON1 As String
BUTTON1 = "&Attach"
End Property
'This was: Const BUTTON2 = "&Cancel"
Property Get BUTTON2 As String
BUTTON2 = "&Cancel"
End Property
'This was: Const Label1 = "Attachment &Name:"
Property Get Label1 As String
Label1 = "Attachment &Name:"
End Property
'This was: Const Label2 = "&Database Name:"
Property Get Label2 As String
Label2 = "&Database Name:"
End Property
'This was: Const LABEL3 = "C&onnect String:"
Property Get LABEL3 As String
LABEL3 = "C&onnect String:"
End Property
'This was: Const LABEL4 = "&Table to Attach:"
Property Get LABEL4 As String
LABEL4 = "&Table to Attach:"
End Property
'This was: Const CHECK1 = "AttachSave&PWD"
Property Get CHECK1 As String
CHECK1 = "AttachSave&PWD"
End Property
'This was: Const CHECK2 = "Attach&Exclusive"
Property Get CHECK2 As String
CHECK2 = "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.
Me.Caption = "New Attachment"
chkExclusive.Caption = "AttachExclusive"
chkSavePassword.Caption = "AttachSavePWD"
cmdCancel.Caption = "&Cancel"
cmdAttach.Caption = "&Attach"
lblLabels(1).Caption = "Database Name: "
lblLabels(3).Caption = "Table to Attach: "
lblLabels(2).Caption = "Connect String: "
lblLabels(0).Caption = "Attachment Name: "
End Sub