home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2002 December / INTERNET97.ISO / pc / software / windows / building / xmlspy / setup44.exe / Data1.cab / F1507_DlgExpDest.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-06-20  |  9.4 KB  |  302 lines

  1. VERSION 5.00
  2. Begin VB.Form DlgExpDest 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Export destination"
  5.    ClientHeight    =   4605
  6.    ClientLeft      =   4440
  7.    ClientTop       =   2700
  8.    ClientWidth     =   7200
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    MinButton       =   0   'False
  12.    ScaleHeight     =   4605
  13.    ScaleWidth      =   7200
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.OptionButton OptionDB 
  16.       Caption         =   "Do export to database"
  17.       Height          =   255
  18.       Left            =   3360
  19.       TabIndex        =   12
  20.       Top             =   120
  21.       Width           =   3135
  22.    End
  23.    Begin VB.OptionButton OptionText 
  24.       Caption         =   "Do export to text"
  25.       Height          =   255
  26.       Left            =   120
  27.       TabIndex        =   11
  28.       Top             =   120
  29.       Width           =   3015
  30.    End
  31.    Begin VB.Frame Frame2 
  32.       Caption         =   "Export to database settings"
  33.       Height          =   3375
  34.       Left            =   3360
  35.       TabIndex        =   3
  36.       Top             =   480
  37.       Width           =   3735
  38.       Begin VB.CommandButton BtnBuildODBC 
  39.          Caption         =   "Build"
  40.          Height          =   255
  41.          Left            =   2880
  42.          TabIndex        =   24
  43.          Top             =   2400
  44.          Width           =   735
  45.       End
  46.       Begin VB.CommandButton BtnBuildADO 
  47.          Caption         =   "Build"
  48.          Height          =   255
  49.          Left            =   2880
  50.          TabIndex        =   23
  51.          Top             =   1680
  52.          Width           =   735
  53.       End
  54.       Begin VB.TextBox TxtODBC 
  55.          Height          =   285
  56.          Left            =   480
  57.          TabIndex        =   22
  58.          Top             =   2400
  59.          Width           =   2295
  60.       End
  61.       Begin VB.OptionButton OptODBC 
  62.          Caption         =   "Use ODBC connection"
  63.          Height          =   255
  64.          Left            =   240
  65.          TabIndex        =   21
  66.          Top             =   2160
  67.          Width           =   2895
  68.       End
  69.       Begin VB.TextBox TxtADO 
  70.          Height          =   285
  71.          Left            =   480
  72.          TabIndex        =   20
  73.          Top             =   1680
  74.          Width           =   2295
  75.       End
  76.       Begin VB.OptionButton OptADO 
  77.          Caption         =   "Use ADO connection"
  78.          Height          =   255
  79.          Left            =   240
  80.          TabIndex        =   19
  81.          Top             =   1440
  82.          Width           =   2775
  83.       End
  84.       Begin VB.CheckBox CheckTables 
  85.          Caption         =   "Create missing tables (text field length is 255 characters)"
  86.          Height          =   375
  87.          Left            =   240
  88.          TabIndex        =   18
  89.          Top             =   2880
  90.          Width           =   3015
  91.       End
  92.       Begin VB.CommandButton BtnBrowseDB 
  93.          Caption         =   "Browse"
  94.          Height          =   255
  95.          Left            =   2880
  96.          TabIndex        =   17
  97.          Top             =   960
  98.          Width           =   735
  99.       End
  100.       Begin VB.TextBox DBFileEdit 
  101.          Height          =   285
  102.          Left            =   720
  103.          TabIndex        =   15
  104.          Text            =   "file"
  105.          Top             =   960
  106.          Width           =   2055
  107.       End
  108.       Begin VB.OptionButton OptionExistingDB 
  109.          Caption         =   "Use existing MS Access database"
  110.          Height          =   255
  111.          Left            =   240
  112.          TabIndex        =   14
  113.          Top             =   720
  114.          Width           =   3015
  115.       End
  116.       Begin VB.OptionButton OptionNewDB 
  117.          Caption         =   "Create new MS Access database"
  118.          Height          =   255
  119.          Left            =   240
  120.          TabIndex        =   13
  121.          Top             =   360
  122.          Width           =   2775
  123.       End
  124.       Begin VB.Label Label5 
  125.          Caption         =   "File:"
  126.          Height          =   255
  127.          Left            =   300
  128.          TabIndex        =   16
  129.          Top             =   1020
  130.          Width           =   375
  131.       End
  132.    End
  133.    Begin VB.Frame Frame1 
  134.       Caption         =   "Export to text settings"
  135.       Height          =   2055
  136.       Left            =   120
  137.       TabIndex        =   2
  138.       Top             =   480
  139.       Width           =   3015
  140.       Begin VB.CommandButton BtnBrowse 
  141.          Caption         =   "Browse"
  142.          Height          =   255
  143.          Left            =   2160
  144.          TabIndex        =   10
  145.          Top             =   480
  146.          Width           =   735
  147.       End
  148.       Begin VB.TextBox FolderEdit 
  149.          Height          =   285
  150.          Left            =   240
  151.          TabIndex        =   8
  152.          Text            =   "folder"
  153.          Top             =   480
  154.          Width           =   1815
  155.       End
  156.       Begin VB.CheckBox CheckHeader 
  157.          Caption         =   "Create header row"
  158.          Height          =   255
  159.          Left            =   240
  160.          TabIndex        =   4
  161.          Top             =   840
  162.          Width           =   2535
  163.       End
  164.       Begin VB.Label Label4 
  165.          Caption         =   "Destination folder:"
  166.          Height          =   255
  167.          Left            =   240
  168.          TabIndex        =   9
  169.          Top             =   240
  170.          Width           =   1695
  171.       End
  172.       Begin VB.Label Label3 
  173.          Caption         =   "There is no enclosing character"
  174.          Height          =   255
  175.          Left            =   240
  176.          TabIndex        =   7
  177.          Top             =   1200
  178.          Width           =   2535
  179.       End
  180.       Begin VB.Label Label2 
  181.          Caption         =   "Field delimiter is 0x09"
  182.          Height          =   255
  183.          Left            =   240
  184.          TabIndex        =   6
  185.          Top             =   1440
  186.          Width           =   2535
  187.       End
  188.       Begin VB.Label Label1 
  189.          Caption         =   "File extension is .txt"
  190.          Height          =   255
  191.          Left            =   240
  192.          TabIndex        =   5
  193.          Top             =   1680
  194.          Width           =   2535
  195.       End
  196.    End
  197.    Begin VB.CommandButton CancelButton 
  198.       Caption         =   "Cancel"
  199.       Height          =   375
  200.       Left            =   4080
  201.       TabIndex        =   1
  202.       Top             =   4080
  203.       Width           =   1215
  204.    End
  205.    Begin VB.CommandButton OKButton 
  206.       Caption         =   "Export"
  207.       Height          =   375
  208.       Left            =   5760
  209.       TabIndex        =   0
  210.       Top             =   4080
  211.       Width           =   1215
  212.    End
  213. Attribute VB_Name = "DlgExpDest"
  214. Attribute VB_GlobalNameSpace = False
  215. Attribute VB_Creatable = False
  216. Attribute VB_PredeclaredId = True
  217. Attribute VB_Exposed = False
  218. Public bOK As Boolean
  219. Option Explicit
  220. Private Sub BtnBrowse_Click()
  221.     Dim pos As Long
  222.     Dim objDlg
  223.     Set objDlg = CreateObject("MSComDlg.CommonDialog")
  224.     objDlg.DialogTitle = "Please locate a file in the destination folder"
  225.     objDlg.ShowOpen
  226.     If Len(objDlg.FileName) > 0 Then
  227.         pos = InStrRev(objDlg.FileName, "\")
  228.         If pos > 3 Then
  229.             FolderEdit.Text = Left(objDlg.FileName, pos)
  230.         Else
  231.             FolderEdit.Text = objDlg.FileName
  232.         End If
  233.     End If
  234. End Sub
  235. Private Sub BtnBrowseDB_Click()
  236.     Dim pos As Long
  237.     Dim objDlg
  238.     Set objDlg = CreateObject("MSComDlg.CommonDialog")
  239.     objDlg.DialogTitle = "Locate a file in the destination folder"
  240.     If OptionExistingDB.Value = True Then
  241.         objDlg.DialogTitle = "Locate the MS Access file"
  242.     End If
  243.     objDlg.ShowOpen
  244.     DBFileEdit.Text = objDlg.FileName
  245.     If OptionNewDB.Value = True Then
  246.         If Len(objDlg.FileName) > 0 Then
  247.             pos = InStrRev(objDlg.FileName, "\")
  248.             If pos > 3 Then
  249.                 DBFileEdit.Text = Left(objDlg.FileName, pos)
  250.             End If
  251.         End If
  252.     End If
  253. End Sub
  254. Private Sub BtnBuildADO_Click()
  255.     Dim objADO As DataLinks
  256.     Set objADO = CreateObject("DataLinks")
  257.     If Not (objADO Is Nothing) Then
  258.         Dim objConn As Connection
  259.         Set objConn = objADO.PromptNew
  260.         TxtADO.Text = objConn.ConnectionString
  261.     End If
  262. End Sub
  263. Private Sub BtnBuildODBC_Click()
  264.     Dim objDB As DBEngine
  265.     Set objDB = CreateObject("DAO.DBEngine.36")
  266.     If Not (objDB Is Nothing) Then
  267.         Dim objWS As DAO.Workspace
  268.         Set objWS = objDB.CreateWorkspace("", "Build", "", DAO.WorkspaceTypeEnum.dbUseODBC)
  269.         
  270.         Dim objConnection As DAO.Connection
  271.         Dim strName As String
  272.         strName = ""
  273.         
  274.         On Error Resume Next
  275.         Set objConnection = objWS.OpenConnection(strName, dbDriverPrompt)
  276.         
  277.         If Not (objConnection Is Nothing) Then
  278.             TxtODBC = objConnection.Connect
  279.         End If
  280.     End If
  281. End Sub
  282. Private Sub CancelButton_Click()
  283.     Hide
  284. End Sub
  285. Private Sub Form_Activate()
  286.     bOK = False
  287.     OptionText.Value = True
  288.     OptionNewDB.Value = True
  289. End Sub
  290. Private Sub OKButton_Click()
  291.     bOK = True
  292.     Hide
  293. End Sub
  294. Private Sub OptionDB_Click()
  295.     Frame2.Enabled = True
  296.     Frame1.Enabled = False
  297. End Sub
  298. Private Sub OptionText_Click()
  299.     Frame2.Enabled = False
  300.     Frame1.Enabled = True
  301. End Sub
  302.