level 5
Public Sub RecordFind() frmManRecord2.Show 1 If Trim(frmManRecord2.sQSql & " ") <> "" Then msSql = msSelect & msTableName & " where" & frmManRecord2.sQSql & msOrderBy ShowData End If Unload frmManRecord2End Sub我在调试的时候就是在这里出现的问题: msSql = msSelect & msTableName & " where" & frmManRecord2.sQSql & msOrderBy
2008年08月07日 06点08分
1
level 0
什么问题? 并且把 msSelect 和 msTableName 的内容打出来!~
2008年08月07日 06点08分
2
level 0
msSelect msTableName sQSql msOrderBy 这4个变量都定义了吗?
2008年08月07日 06点08分
5
level 5
lblTitle.Top = lblTitle.Height lblTitle.Left = (Me.Width - lblTitle.Width) / 2 msgList.Top = lblTitle.Top + lblTitle.Height + lblTitle.Height / 2 msgList.Width = Me.ScaleWidth - 200 msgList.Left = Me.ScaleLeft + 100 msgList.Height = Me.ScaleHeight - msgList.Top - 200
2008年08月07日 06点08分
7
level 5
Option ExplicitPublic mrc As ADODB.RecordsetPublic txtSQL As StringPublic MsgText As StringPrivate Sub Form_Unload(Cancel As Integer) flagEdit = False gintMode = 0End SubPrivate Sub Form_Load() ShowTitle ShowData flagEdit = TrueEnd SubPrivate Sub Form_Resize() If Me.WindowState <> vbMinimized And frmMain.WindowState <> vbMinimized Then If Me.ScaleHeight < 10 * lblTitle.Height Then Exit Sub End If If Me.ScaleWidth < lblTitle.Width + lblTitle.Width / 2 Then Exit Sub End If lblTitle.Top = lblTitle.Height lblTitle.Left = (Me.Width - lblTitle.Width) / 2 msgList.Top = lblTitle.Top + lblTitle.Height + lblTitle.Height / 2 msgList.Width = Me.ScaleWidth - 200 msgList.Left = Me.ScaleLeft + 100 msgList.Height = Me.ScaleHeight - msgList.Top - 200 End IfEnd SubPublic Sub FormClose() flagEdit = False Unload MeEnd SubPublic Sub RecordFind() frmManRecord2.Show 1 If Trim(frmManRecord2.sQSql & " ") <> "" Then msSql = msSelect & msTableName & " where" & frmManRecord2.sQSql & msOrderBy ShowData End If Unload frmManRecord2End SubPublic Sub ShowData() Dim j As Integer Dim i As Integer If Trim(txtSQL) = "" Then txtSQL = "select * from manrecord" End If Set mrc = ExecuteSQL(txtSQL, MsgText) If mrc.EOF = False Then With msgList .Rows = 1 Do While Not mrc.EOF .Rows = .Rows + 1 For i = 1 To mrc.Fields.Count Select Case mrc.Fields(i - 1).Type Case adDBDate .TextMatrix(.Rows - 1, i) = Format(mrc.Fields(i - 1) & "", "yyyy-mm-dd") Case Else .TextMatrix(.Rows - 1, i) = mrc.Fields(i - 1) & "" End Select Next i mrc.MoveNext Loop End With End If mrc.Close End Sub
2008年08月07日 06点08分
8