执行后结果,只不过出现了符合Z(1)=“银行存款”数额的J(1)字段的记录!
但是,这程序好象却没有能够实现循环!!??
执行后结果,只不过出现了符合Z(1)=“银行存款”数额的J(1)字段的记录!
但是,这程序好象却没有能够实现循环!!??
2007-08-23 21:51
2007-08-23 22:14
改为:
Private Sub Command1_Click()
Dim jj, ss, ii As Integer
Dim mysql As String
For jj = 1 To 9
mysql = "select * from fl2 where [z(" & jj & ")]='银行存款' "
If Conn.Execute(mysql).EOF = False And IsNull(Conn.Execute(mysql)(0)) = False Then
Set Rst = Conn.Execute(mysql)
End If
ss = Rst.Fields.Count
If Rst.BOF = True Then
MsgBox "no!"
Else
Set DataGrid1.DataSource = Rst
For ii = 0 To ss - 1
DataGrid1.Columns(ii).Alignment = dbgCenter
DataGrid1.Columns(ii).Width = 1000
Next ii
DataGrid1.AllowUpdate = False
End If
Next
End Sub
怎么就显示一个记录呢?
没有实现循环???!!!
2007-08-23 22:15
依照提示改为如下:
Private Sub Command1_Click()
Dim ii, ss, jj As Integer
Dim mysql As String
For jj = 1 To 9
mysql = "Select [j(" & jj & ")] from fl2 where [z(" & jj & ")]='银行存款' "
If Conn.Execute(mysql).EOF = False And IsNull(Conn.Execute(mysql)(0)) = False Then
Set Rst = Conn.Execute(mysql)
End If
Next jj
If Rst.BOF = True Then
MsgBox "no!"
Else
Set DataGrid1.DataSource = Rst
ss = Rst.Fields.Count = 1
For ii = 0 To ss - 1 = 0
DataGrid1.Columns(ii).Alignment = dbgCenter
DataGrid1.Columns(ii).Width = 1000
Next ii
DataGrid1.AllowUpdate = False
End If
End Sub
但结果仍然照旧!
2007-08-24 19:57
2007-08-24 20:47
我想把每个记录中Z(I)字段值=“银行存款”时对应的J(I)或D(I)的值排列输出来!
以前是总计数,代码如下:
For i2 = 1 To 9
s2 = "Select Sum([j(" & i2 & ")]) from fl2 where [z(" & i2 & ")]='银行存款' GROUP BY [Z(" & i2 & ")]"
If conn.Execute(s2).EOF = False And IsNull(conn.Execute(s2)(0)) = False Then
a2 = a2 + conn.Execute(s2)(0)
End If
Next
2007-08-24 21:30
2007-08-25 11:45
2007-08-26 14:10
2007-08-26 15:18
我想用表之间的关系来达到目的,
FL2表为47个字段;
用FL3表来显示所需要的表内容,字段为:N(日期,FL2表也有相应的N字段),ZY(摘要,FL2表也有相应的ZY(1~9)字段),J(借方数额,FL2表也有相应的J(1~9)字段),D(贷方数额,FL2表也有相应的D(1~9)字段),
书上对关系这方面的描述过于简单,仍然看不明白!
2007-08-26 15:25