www.pudn.com > new xsc.rar > frmriqi.frm


VERSION 5.00 
Begin VB.Form frmriqi  
   Caption         =   "报表生成" 
   ClientHeight    =   3195 
   ClientLeft      =   60 
   ClientTop       =   345 
   ClientWidth     =   4515 
   LinkTopic       =   "Form1" 
   MaxButton       =   0   'False 
   MDIChild        =   -1  'True 
   ScaleHeight     =   3195 
   ScaleWidth      =   4515 
   Begin VB.TextBox Text13  
      DataField       =   "name1" 
      DataMember      =   "Command1" 
      DataSource      =   "DataEnvironment1" 
      Height          =   375 
      Left            =   3600 
      TabIndex        =   16 
      Text            =   "Text13" 
      Top             =   1920 
      Visible         =   0   'False 
      Width           =   735 
   End 
   Begin VB.TextBox Text12  
      DataField       =   "heji" 
      DataMember      =   "Command1" 
      DataSource      =   "DataEnvironment1" 
      Height          =   270 
      Left            =   3000 
      TabIndex        =   15 
      Text            =   "Text12" 
      Top             =   1920 
      Visible         =   0   'False 
      Width           =   495 
   End 
   Begin VB.TextBox Text11  
      DataField       =   "riqi" 
      DataMember      =   "Command1" 
      DataSource      =   "DataEnvironment1" 
      Height          =   270 
      Left            =   3720 
      TabIndex        =   14 
      Text            =   "Text11" 
      Top             =   1440 
      Visible         =   0   'False 
      Width           =   180 
   End 
   Begin VB.TextBox Text10  
      DataField       =   "class" 
      DataMember      =   "Command1" 
      DataSource      =   "DataEnvironment1" 
      Height          =   270 
      Left            =   3120 
      TabIndex        =   13 
      Text            =   "Text10" 
      Top             =   1440 
      Visible         =   0   'False 
      Width           =   180 
   End 
   Begin VB.TextBox Text9  
      DataField       =   "qita" 
      DataMember      =   "Command1" 
      DataSource      =   "DataEnvironment1" 
      Height          =   270 
      Left            =   2640 
      TabIndex        =   12 
      Text            =   "Text9" 
      Top             =   1440 
      Visible         =   0   'False 
      Width           =   180 
   End 
   Begin VB.TextBox Text8  
      DataField       =   "jititongbao" 
      DataMember      =   "Command1" 
      DataSource      =   "DataEnvironment1" 
      Height          =   375 
      Left            =   2040 
      TabIndex        =   11 
      Text            =   "Text8" 
      Top             =   1440 
      Visible         =   0   'False 
      Width           =   375 
   End 
   Begin VB.TextBox Text7  
      DataField       =   "huodong" 
      DataMember      =   "Command1" 
      DataSource      =   "DataEnvironment1" 
      Height          =   375 
      Left            =   1200 
      TabIndex        =   10 
      Text            =   "Text7" 
      Top             =   1560 
      Visible         =   0   'False 
      Width           =   615 
   End 
   Begin VB.TextBox Text6  
      DataField       =   "cailiao" 
      DataMember      =   "Command1" 
      DataSource      =   "DataEnvironment1" 
      Height          =   375 
      Left            =   360 
      TabIndex        =   9 
      Text            =   "Text6" 
      Top             =   1440 
      Visible         =   0   'False 
      Width           =   495 
   End 
   Begin VB.TextBox Text5  
      DataField       =   "qinshi" 
      DataMember      =   "Command1" 
      DataSource      =   "DataEnvironment1" 
      Height          =   270 
      Left            =   3480 
      TabIndex        =   8 
      Text            =   "Text5" 
      Top             =   360 
      Visible         =   0   'False 
      Width           =   615 
   End 
   Begin VB.TextBox Text4  
      DataField       =   "koufen" 
      DataMember      =   "Command1" 
      DataSource      =   "DataEnvironment1" 
      Height          =   270 
      Left            =   2640 
      TabIndex        =   7 
      Text            =   "Text4" 
      Top             =   360 
      Visible         =   0   'False 
      Width           =   615 
   End 
   Begin VB.TextBox Text3  
      DataField       =   "banhui" 
      DataMember      =   "Command1" 
      DataSource      =   "DataEnvironment1" 
      Height          =   270 
      Left            =   1920 
      TabIndex        =   6 
      Text            =   "Text3" 
      Top             =   360 
      Visible         =   0   'False 
      Width           =   495 
   End 
   Begin VB.TextBox Text2  
      DataField       =   "lihui" 
      DataMember      =   "Command1" 
      DataSource      =   "DataEnvironment1" 
      Height          =   270 
      Left            =   1200 
      TabIndex        =   5 
      Text            =   "Text2" 
      Top             =   360 
      Visible         =   0   'False 
      Width           =   495 
   End 
   Begin VB.TextBox Text1  
      DataField       =   "jiben" 
      DataMember      =   "Command1" 
      DataSource      =   "DataEnvironment1" 
      Height          =   270 
      Left            =   360 
      TabIndex        =   4 
      Text            =   "Text1" 
      Top             =   360 
      Visible         =   0   'False 
      Width           =   615 
   End 
   Begin VB.CommandButton Command2  
      Caption         =   "确定" 
      Height          =   495 
      Left            =   720 
      TabIndex        =   3 
      Top             =   2280 
      Width           =   1455 
   End 
   Begin VB.CommandButton Command1  
      Caption         =   "取消" 
      Height          =   495 
      Left            =   2520 
      TabIndex        =   1 
      Top             =   2280 
      Width           =   1455 
   End 
   Begin VB.TextBox Text0  
      Height          =   375 
      Left            =   2640 
      MaxLength       =   7 
      TabIndex        =   0 
      Top             =   840 
      Width           =   1575 
   End 
   Begin VB.Label Label1  
      Caption         =   "将何月津贴生成报表请输入时间(格式如下:2004-5)" 
      Height          =   420 
      Left            =   240 
      TabIndex        =   2 
      Top             =   840 
      Width           =   2280 
   End 
End 
Attribute VB_Name = "frmriqi" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Private Sub Command1_Click() 
  Unload Me 
End Sub 
 
Private Sub Command2_Click() 
  If Not IsDate(Format(Trim(Text0.Text & "-" & "1"), "yyyy-mm-dd")) Then 
     MsgBox "请输入正确的日期格式!", vbOKOnly + vbExclamation, "警告" 
     Text0.SetFocus 
     Exit Sub 
   End If 
   
  Dim mrccc1, mr As ADODB.Recordset 
  Dim msgtext1 As String 
  Dim txtSQL As String 
  Dim a As String 
  Dim i As Integer 
  i = 1 
  txtSQL = "delete from jintietiao where class<>''" 
  Set mrccc1 = ExecuteSQL(txtSQL, msgtext1) 
  a = Format(CDate(Text0.Text & "-" & "1"), "yyyy-mm-dd") 
  txtSQL = "select * from jintie where riqi='" & a & "'" 
  Set mrccc1 = ExecuteSQL(txtSQL, msgtext1) 
  If mrccc1.EOF = True Then 
    MsgBox "找不到任何纪录!", vbOKOnly + vbExclamation, "警告" 
    Exit Sub 
  Else 
      Do While Not mrccc1.EOF 
        'txtsql="select zaizhi from teacher where class='"&&"'" 
         txtSQL = "insert into jintietiao values('" & mrccc1.Fields(0) & "','" & mrccc1.Fields(1) & "','" & mrccc1.Fields(2) & "','" & mrccc1.Fields(3) & "','" & mrccc1.Fields(4) & "','" & mrccc1.Fields(5) & "','" & mrccc1.Fields(6) & "','" & mrccc1.Fields(7) & "','" & mrccc1.Fields(8) & "','" & mrccc1.Fields(9) & "','" & mrccc1.Fields(10) & "','" & mrccc1.Fields(11) & "','" & mrccc1.Fields(12) & "')" 
 
    Set mr = ExecuteSQL(txtSQL, msgtext1) 
      mrccc1.MoveNext 
    Loop 
    mrccc1.Close 
   a = MsgBox("是否生成报表?", vbOKCancel, "警告") 
   If a = vbOK Then 
      DataEnvironment1.Connection1.Close 
      DataEnvironment1.Connection1.Open 
      DataEnvironment1.Commands("Command3").ActiveConnection = DataEnvironment1.Connection1 
      DataEnvironment1.Commands("Command3").CommandText = "dbo.jintietiao" 
       
      DataReport1.Show 
   End If 
  End If 
End Sub 
 
Private Sub Form_Load() 
 Me.Height = 3600 
 Me.Width = 4800 
 
End Sub