⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frm_fwinfosc.frm

📁 小区物业管理系统,(vb6+SQLServer2000+使用说明)
💻 FRM
📖 第 1 页 / 共 3 页
字号:
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   2052
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
         EndProperty
      End
   End
   Begin VB.Frame Frame1 
      Caption         =   "选择小区"
      Height          =   780
      Left            =   60
      TabIndex        =   0
      Top             =   75
      Width           =   2505
      Begin VB.ComboBox Combo1 
         Height          =   300
         ItemData        =   "Frm_fwinfosc.frx":1CDC
         Left            =   1155
         List            =   "Frm_fwinfosc.frx":1CDE
         Style           =   2  'Dropdown List
         TabIndex        =   1
         Top             =   285
         Width           =   1245
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "小区名称:"
         Height          =   180
         Left            =   150
         TabIndex        =   2
         Top             =   360
         Width           =   900
      End
   End
   Begin MSAdodcLib.Adodc Adodc6 
      Height          =   330
      Left            =   240
      Top             =   4425
      Visible         =   0   'False
      Width           =   1830
      _ExtentX        =   3228
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   1
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Label Label17 
      Caption         =   "Label17"
      DataField       =   "房间结构"
      DataSource      =   "Adodc5"
      Height          =   300
      Left            =   4005
      TabIndex        =   35
      Top             =   4740
      Width           =   1440
   End
   Begin VB.Label Label16 
      Caption         =   "Label16"
      DataField       =   "权属类型"
      DataSource      =   "Adodc4"
      Height          =   315
      Left            =   4035
      TabIndex        =   34
      Top             =   4770
      Width           =   1065
   End
   Begin VB.Label Label14 
      Caption         =   "Label14"
      Height          =   255
      Left            =   4080
      TabIndex        =   21
      Top             =   4935
      Width           =   1155
   End
   Begin VB.Label Label13 
      AutoSize        =   -1  'True
      Caption         =   "Label13"
      DataField       =   "大楼名称"
      DataSource      =   "Adodc2"
      Height          =   180
      Left            =   4140
      TabIndex        =   19
      Top             =   4920
      Width           =   630
   End
End
Attribute VB_Name = "Frm_fwinfosc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Combo2_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then Combo3.SetFocus
End Sub

Private Sub Combo3_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then Combo4.SetFocus
End Sub
Private Sub Combo4_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then Combo5.SetFocus
End Sub

Private Sub Combo5_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then Combo6.SetFocus
End Sub

Private Sub Combo6_KeyPress(KeyAscii As Integer)
    If KeyAscii = 13 Then Command1.SetFocus
End Sub


Private Sub Form_Load()
    '自动识别路径
    Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db_wygl.mdb;Persist Security Info=False"
    Adodc1.RecordSource = "select * from tab_xqinfo"
    Adodc1.Refresh
    On Error Resume Next
    If Adodc1.Recordset.RecordCount > 0 Then
        Adodc1.Recordset.MoveFirst
        Do While Adodc1.Recordset.EOF = False
            Combo1.AddItem Adodc1.Recordset.Fields("小区名称")
            Adodc1.Recordset.MoveNext
        Loop
    End If
    Adodc3.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db_wygl.mdb;Persist Security Info=False"
    Adodc3.RecordSource = "select * from tab_frontage"
    Adodc3.Refresh
    If Adodc3.Recordset.RecordCount > 0 Then
        Adodc3.Recordset.MoveFirst
        Do While Adodc3.Recordset.EOF = False
            Combo2.AddItem Adodc3.Recordset.Fields("房屋朝向")
            Adodc3.Recordset.MoveNext
        Loop
    End If
    Adodc5.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db_wygl.mdb;Persist Security Info=False"
    Adodc5.RecordSource = "select * from tab_fjstructure"
    Adodc5.Refresh
    If Adodc5.Recordset.RecordCount > 0 Then
        Adodc5.Recordset.MoveFirst
        Do While Adodc5.Recordset.EOF = False
            Combo4.AddItem Adodc5.Recordset.Fields("房间结构")
            Adodc5.Recordset.MoveNext
        Loop
    End If
    Adodc2.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db_wygl.mdb;Persist Security Info=False"
'    Adodc2.RecordSource = "select * from tab_dlinfo"
'    Adodc2.Refresh
    
    Adodc4.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db_wygl.mdb;Persist Security Info=False"
    Adodc4.RecordSource = "select * from tab_qstype"
    Adodc4.Refresh

    Adodc6.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db_wygl.mdb;Persist Security Info=False"
    Adodc6.RecordSource = "select * from tab_xqinfo"
    Adodc6.Refresh

End Sub
Private Sub Combo1_Click()
    Text6.Text = Combo1.Text
    Adodc2.RecordSource = "select * from tab_dlinfo where 大楼编号 like '" + Combo1.Text + "%'"
    Adodc2.Refresh
        
        Set DataGrid1.DataSource = Adodc2

End Sub
Private Sub Command1_Click()   '开始生成
    If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Combo1.Text = "" Then
        MsgBox "你输入的信息不完整,请将信息补充完整!", , "系统提示"
        Exit Sub
    End If
    
    
    Dim rs1 As New ADODB.Recordset
    rs1.Open "select * from tab_fwinfo where 小区名称='" + Combo1.Text + "' and 大楼名称 like '%" + Adodc2.Recordset.Fields("大楼名称") + "%'", cn, adOpenKeyset, adLockOptimistic
    If rs1.RecordCount > 0 Then
        MsgBox "该大楼的房屋信息已经生成!", , "系统提示"
    Else
        Dim m As String
        Dim a, b, c, d, e, f As Integer
        b = Val(Text2.Text)
        c = Val(Text3.Text)
        d = Val(Text4.Text)
        'Val 函数返回包含于字符串内的数字,字符串中是一个适当类型的数值。
        For a = Val(Text1) To b
            For e = 1 To c
                For f = 1 To d
                    Text5.Text = Combo1.Text + Label13.Caption + Trim(Str(a)) + Trim(Str(e)) + Trim(Str(f))
                    'Trim 函数返回 Variant (String),其中包含指定字符串的拷贝,没有前导和尾随空白。
                    'Str 函数返回代表一数值的 Variant (String)。
                    Adodc6.RecordSource = "select * from tab_fwinfo"
                    Adodc6.Refresh
                    If Adodc6.Recordset.RecordCount > 0 Then   '如果记录数大于零
                        Adodc6.Recordset.MoveFirst
                        Do While Adodc6.Recordset.EOF = False
                            If Adodc6.Recordset.Fields("房间编号") = Trim(Text5) Then
                                GoTo L:
                            Else
                                Adodc6.Recordset.MoveNext
                            End If
                        Loop
                        Set adors = cn.Execute("insert into tab_fwinfo (房间编号,小区名称,大楼名称,单元,楼层,权属类型,房间结构,配备设施,房间类别,朝向) values('" & Trim(Text5) & "','" & Trim(Text6) & "','" & Trim(Label13) & "','" & Trim(Str(a)) & "','" & Trim(Str(e)) & "','" & Trim(Combo3.Text) & "','" & Trim(Combo4.Text) & "','" & Trim(Combo5.Text) & "','" & Trim(Combo6.Text) & "','" & Trim(Combo2.Text) & "')")
                    Else
                        Set adors = cn.Execute("insert into tab_fwinfo (房间编号,小区名称,大楼名称,单元,楼层,权属类型,房间结构,配备设施,房间类别,朝向) values('" & Trim(Text5) & "','" & Trim(Text6) & "','" & Trim(Label13) & "','" & Trim(Str(a)) & "','" & Trim(Str(e)) & "','" & Trim(Combo3.Text) & "','" & Trim(Combo4.Text) & "','" & Trim(Combo5.Text) & "','" & Trim(Combo6.Text) & "','" & Trim(Combo2.Text) & "')")
                    End If
L:
                Next f
            Next e
        Next a
        MsgBox "数据保存成功!", , "系统提示"
        Unload Me
        Adodc6.Refresh
    End If
End Sub

Private Sub Command2_Click()  '返回主系统
    Unload Me
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then Text2.SetFocus
End Sub

Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then Text3.SetFocus
End Sub

Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then Text4.SetFocus
End Sub

Private Sub Text4_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then Combo2.SetFocus
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -