【VB开源代码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。网学会员整理了VB开源代码-frmgg.frm的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
VERSION 5.00
Object = "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}#6.0#0"; "MSHFLXGD.OCX"
Begin VB.Form frmgg
Caption = "公告"
ClientHeight = 6585
ClientLeft = 60
ClientTop = 345
ClientWidth = 8175
LinkTopic = "Form1"
ScaleHeight = 6585
ScaleWidth = 8175
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "退出"
Height = 375
Left = 5400
TabIndex = 6
Top = 5880
Width = 975
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 2520
TabIndex = 5
Top = 5880
Width = 975
End
Begin VB.TextBox Text2
Height = 1335
Left = 1440
TabIndex = 4
Top = 4080
Width = 6255
End
Begin VB.TextBox Text1
Height = 495
Left = 1440
TabIndex = 2
Top = 3240
Width = 4095
End
Begin MSHierarchicalFlexGridLib.MSHFlexGrid HFGrid
Height = 2595
Left = 360
TabIndex = 0
Top = 120
Width = 7455
_ExtentX = 13150
_ExtentY = 4577
_Version = 393216
FixedCols = 0
BackColorSel = 16777215
ForeColorSel = -2147483641
BackColorBkg = -2147483639
FocusRect = 0
ScrollBars = 2
SelectionMode = 1
AllowUserResizing= 1
Appearance = 0
_NumberOfBands = 1
_Band(0).Cols = 2
End
Begin
VB.Label Label2
Caption = "内容:"
Height = 495
Left = 360
TabIndex = 3
Top = 4080
Width = 975
End
Begin VB.Label Label1
Caption = "主题:"
Height = 495
Left = 360
TabIndex = 1
Top = 3240
Width = 1095
End
End
Attribute VB_Name = "frmgg"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "主题不能为空"
Exit Sub
End If
Dim a As String
a = Date
Dim strsql As String
strsql = "insert into 公告(发布者,标题,日期,消息,did) values ('" & Loginname & "','" & Text1.Text & "','" & a & "','" & Text2.Text & "',0)"
If exsql(str
sql) Then
MsgBox "发布成功"
Text1.SetFocus
Call aaa
Text1.Text = ""
Text2.Text = ""
Else
MsgBox "发布失败"
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Public Sub aaa()
Dim strsql As String
strsql = "select id as 编号,发布者,标题,日期,消息 from 公告"
Dim rs As New ADODB.Recordset
Set rs = AdoSet(strsql)
Set HFGrid.DataSource = rs
End Sub
Private Sub Form_Load()
Call aaa
End Sub