home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 4_2005-2006.ISO / data / Zips / SQL_Genera1975452222006.psc / frmGenerator.frm < prev    next >
Text File  |  2004-04-13  |  5KB  |  151 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.Form frmGenerator 
  4.    Caption         =   "SQL Code Generator"
  5.    ClientHeight    =   1530
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   9555
  9.    Icon            =   "frmGenerator.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    LockControls    =   -1  'True
  12.    ScaleHeight     =   1530
  13.    ScaleWidth      =   9555
  14.    StartUpPosition =   2  'CenterScreen
  15.    Begin MSComDlg.CommonDialog ctlDialog 
  16.       Left            =   120
  17.       Top             =   1830
  18.       _ExtentX        =   847
  19.       _ExtentY        =   847
  20.       _Version        =   393216
  21.    End
  22.    Begin VB.CommandButton cmdCancel 
  23.       Cancel          =   -1  'True
  24.       Caption         =   "Cancel"
  25.       BeginProperty Font 
  26.          Name            =   "MS Sans Serif"
  27.          Size            =   8.25
  28.          Charset         =   0
  29.          Weight          =   700
  30.          Underline       =   0   'False
  31.          Italic          =   0   'False
  32.          Strikethrough   =   0   'False
  33.       EndProperty
  34.       Height          =   375
  35.       Left            =   6420
  36.       TabIndex        =   2
  37.       Top             =   630
  38.       Width           =   3075
  39.    End
  40.    Begin VB.CommandButton cmdRun 
  41.       Caption         =   "Run SQL Generation Process"
  42.       BeginProperty Font 
  43.          Name            =   "MS Sans Serif"
  44.          Size            =   8.25
  45.          Charset         =   0
  46.          Weight          =   700
  47.          Underline       =   0   'False
  48.          Italic          =   0   'False
  49.          Strikethrough   =   0   'False
  50.       EndProperty
  51.       Height          =   375
  52.       Left            =   3240
  53.       TabIndex        =   1
  54.       Top             =   630
  55.       Width           =   3075
  56.    End
  57.    Begin VB.CommandButton cmdLocate 
  58.       Caption         =   "Locate XML Schema File"
  59.       BeginProperty Font 
  60.          Name            =   "MS Sans Serif"
  61.          Size            =   8.25
  62.          Charset         =   0
  63.          Weight          =   700
  64.          Underline       =   0   'False
  65.          Italic          =   0   'False
  66.          Strikethrough   =   0   'False
  67.       EndProperty
  68.       Height          =   375
  69.       Left            =   60
  70.       TabIndex        =   0
  71.       Top             =   630
  72.       Width           =   3075
  73.    End
  74.    Begin VB.Label lbl 
  75.       Caption         =   $"frmGenerator.frx":0442
  76.       Height          =   465
  77.       Left            =   60
  78.       TabIndex        =   4
  79.       Top             =   60
  80.       Width           =   9405
  81.    End
  82.    Begin VB.Label lblFileName 
  83.       BackColor       =   &H80000005&
  84.       BorderStyle     =   1  'Fixed Single
  85.       BeginProperty Font 
  86.          Name            =   "MS Sans Serif"
  87.          Size            =   8.25
  88.          Charset         =   0
  89.          Weight          =   700
  90.          Underline       =   0   'False
  91.          Italic          =   0   'False
  92.          Strikethrough   =   0   'False
  93.       EndProperty
  94.       Height          =   375
  95.       Left            =   60
  96.       TabIndex        =   3
  97.       Top             =   1080
  98.       Width           =   9405
  99.    End
  100. End
  101. Attribute VB_Name = "frmGenerator"
  102. Attribute VB_GlobalNameSpace = False
  103. Attribute VB_Creatable = False
  104. Attribute VB_PredeclaredId = True
  105. Attribute VB_Exposed = False
  106. Option Explicit
  107. Option Base 0
  108.  
  109. Private Const m_strRegKey As String = "Software\SqlGenerator"
  110. Private Const m_strRegValue As String = "FileName"
  111.  
  112. Private Sub cmdCancel_Click()
  113.     End
  114. End Sub
  115.  
  116. Private Sub cmdLocate_Click()
  117.     Dim strFileName As String
  118.     Dim strFilePath As String
  119.     
  120.     If g_strXMLFile = "" Then
  121.         strFileName = ""
  122.         strFilePath = ""
  123.     Else
  124.         strFileName = GetFileName(g_strXMLFile)
  125.         strFilePath = GetFilePath(g_strXMLFile)
  126.     End If
  127.     g_strXMLFile = DialogFileOpen(ctlDialog, "Find XML File", strFileName, strFilePath, "XML Files|*.xml")
  128.     lblFileName.Caption = g_strXMLFile
  129. End Sub
  130.  
  131. Private Sub cmdRun_Click()
  132.     If lblFileName.Caption = "" Then
  133.         MsgBox "The XML schema file must be located prior to performing this function", vbExclamation
  134.         Exit Sub
  135.     End If
  136.     If Not FileExists(lblFileName.Caption) Then
  137.         MsgBox "The XML schema file is not present", vbExclamation
  138.         Exit Sub
  139.     End If
  140.     Call RegistryWriteValueString(HKEY_LOCAL_MACHINE, m_strRegKey, g_strXMLFile, m_strRegValue)
  141.     Call Process
  142. End Sub
  143.  
  144. Private Sub Form_Load()
  145.     g_strXMLFile = RegistryReadValue(HKEY_LOCAL_MACHINE, m_strRegKey, m_strRegValue)
  146.     If Not FileExists(g_strXMLFile) Then
  147.         g_strXMLFile = ""
  148.     End If
  149.     lblFileName.Caption = g_strXMLFile
  150. End Sub
  151.