VB FOR 循环语句 Dim i,j,c As IntegerDim a,b As Stringc = 0Adodc1.RecordSource = " select * from inf where 下单时间 between #" & DTP1.Value & "# and #" & DTP2.Value & "# "Adodc1.RefreshFor j = 0 To Combo1.ListCount - 1b = Combo1.List(j)For i =

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/05 19:32:42
VB FOR 循环语句 Dim i,j,c As IntegerDim a,b As Stringc = 0Adodc1.RecordSource = VB FOR 循环语句
Dim i,j,c As Integer
Dim a,b As String
c = 0
Adodc1.RecordSource = " select * from inf where 下单时间 between #" & DTP1.Value & "# and #" & DTP2.Value & "# "
Adodc1.Refresh
For j = 0 To Combo1.ListCount - 1
b = Combo1.List(j)
For i = 0 To Adodc1.Recordset.RecordCount - 1
a = Adodc1.Recordset.Fields(15).Value
If b = a Then
c = 1 + c
End If
Next i
Text8.Text = Combo1.List(j) + "共" + Str(c) + "记录"
Next j
这里面有一个COMBOBOX控件里面有几个省份的名称(不重复),一个表中的字段(也就是Fields(15))也有省份名称(有重复),现在想统计 这段时间内 表中字段(Fields(15)中)几个省份的名称,结果显示在Text8.text里!如:河南共8条记录,内蒙共3条记录,河南共9条记录……

VB FOR 循环语句 Dim i,j,c As IntegerDim a,b As Stringc = 0Adodc1.RecordSource = " select * from inf where 下单时间 between #" & DTP1.Value & "# and #" & DTP2.Value & "# "Adodc1.RefreshFor j = 0 To Combo1.ListCount - 1b = Combo1.List(j)For i =
用count,否则的话,如果记录太多,你将不停地MoveNext,不停地判断b=a.
Dim i As Integer,n As Long,s As String
Text8 = ""
Adodc1.RecordSource = " select 字段15的名称,count(*) from inf where 下单时间 between #" & DTP1.Value & "# and #" & DTP2.Value & "# group by 字段15的名称"
Adodc1.Refresh
For i = 0 To Combo1.ListCount - 1
s = Combo1.List(i)
n = 0
Adodc1.Recordset.MoveFirst
Do While Not Adodc1.Recordset.EOF
If Adodc1.Recordset.Fields(0) = s Then n = Adodc1.Recordset.Fields(1):Exit Do
Adodc1.Recordset.MoveNext
Loop
Text8 = Text8 & "," & s & "共" & n & "条记录"
Next
将上述语句中的“字段15的名称”修改为你数据库中inf表的第16个字段的字段名称.

VB FOR 循环语句 Dim i,j,c As IntegerDim a,b As Stringc = 0Adodc1.RecordSource = select * from inf where 下单时间 between # & DTP1.Value & # and # & DTP2.Value & # Adodc1.RefreshFor j = 0 To Combo1.ListCount - 1b = Combo1.List(j)For i = VB 2个FOR循环语句求解答X=0For i= 1 to 4For j = 1 to ix= x+1 next j ,i 循环后X 求循环解释两个For 怎么循环 VB循环语句题目 a=0 for i 1 to 5 . 如何用for循环语句计算出1+2+3+.1000的和并且计算1*2*3...*1000的积用vb我把程序写成这样为什么没有结果,应该怎么改了!这是和Dim i,s As Integers= 0For i = 1 To 1000s = s + iNext i这是积Dim i,s As Integers= 0For i vb循环语句中sqr(n)是什么意思for i=2 to sqr(n) 中sqr(n)代表什么意思?我只能肯定不是开根号的意思!Private Sub Form_Click()Dim n As Integern = InputBox(请输入一个正整数(>=3))k = 0For i = 2 To Sqr(n)If n Mod i = 0 Th 循环语句for(var i=0,j=10;i=j=10;i++,j--);的循环次数是_______. 怎么求VB中for语句多重循环后,A的值For i=1 to 3 for i=1 to i for k=j to 3 a=a+1 next k next jnext i 执行上面的3重循环后,a的值为,注:请高手指出求的方法 VB练习题7道,七道全讲完才行一、Private Sub Command1_Cilck()Dim a(4,4)For i = 1 To 4For j = 1 To 4Next jNext iFor j = 3 To 4For j = 3 To 4Print a(j,i);Next jEnd Sub9 1210 13二、Private Sub Form _Click()Dim a(10),p(3)As Integerk = 5For i VB中的Dim sum As Integer语句Dim sum As Integersum = 0For i = 1 To 20sum = sum + ii = i + 1Next iPrint sum=; sum是怎么计算的 计算结果是多少 通过使用双重for循环语句,打印下列图形:#includevoid main(){int i,j,k;for(i=1;i 下面for语句执行时循环次数为( )int i,j;for (i=0,j=5;i=j; ){ cout VB试题 循环语句 for i=20 to 10 step -2的循环次数为 A6 B4 C不循环 D5 循环语句:for(i=1;i 循环语句:for(i=1;i VB 使显示每行的最大值的位置(下面的程序可以把最大值找出)Private Sub cmdbegin_Click() Dim a(4,3) As Integer,i As Integer,j As Integer Dim max As Integer For i = 1 To 4 For j = 1 To 3 a(i,j) = InputBox(请输入矩阵的第 vb程序Dim a(1 To 20) As Integer,i As Integer,j As IntegerDim a(1 To 20) As Integer,i As Integer,j As IntegerPrivate Sub Command1_Click()Dim a(1 To 20) As IntegerFor j = 1 To 2For i = 1 To 10a(i) = Int(Rnd * 21) + 20Text1 = Text1 & Str(a(i))Next iTe vb中for循环和的问题 dim i as integer for i = to 这里i已经被定义为了整形 那么如果我初值附小数是什么情况?会自动取整?:例如for i= 1.5 to 3 中i是从几开始循环?:for i= 1to 3.5 中i又是循环到几?(个人试 下面三个for循环语句分别是什么意思?void delay02s(void ) //延时0.2秒子程序{unsigned char i,j,k;for(i=20;i>0;i--)for(j=20;j>0;j--)for(k=248;k>0;k--);}