arrTraffic(0, inum) = rs.Fields("ID") //取ID的值赋给第//1行,第inum列,下面的以此类推
arrTraffic(1, inum) = rs.Fields("CARNUM")
arrTraffic(2, inum) = rs.Fields("DATENUM")
arrTraffic(3, inum) = rs.Fields("PRODUCTNAME")
arrTraffic(4, inum) = rs.Fields("SENDSTATION")
arrTraffic(5, inum) = rs.Fields("RECEIVESTATION")
arrTraffic(6, inum) = rs.Fields("SENDER")
arrTraffic(7, inum) = rs.Fields("WEIGHT")
arrTraffic(8, inum) = rs.Fields("TOTAL")
inum = inum + 1
rs.MoveNext //指向下一列
Loop
'初始化品名
ReDim arrProduct(1, 0) //初始化一个二位数组
strsql = "SELECT * FROM PRODUCT" // strsql为PRODUCT表
Set rs = sys.DB.OpenRecordSet(strsql)//数据库中查询这个表,结果返回rs
If Not (rs.BOF) Or (rs.EOF) Then
inum = 0
Do While Not rs.EOF
ReDim Preserve arrProduct(1, inum)
arrProduct(0, inum) = rs("ID")
arrProduct(1, inum) = rs("NAME")
rs.MoveNext
inum = inum + 1
Loop
End If
'初始化车站
ReDim arrstation(1, 0)
strsql = "SELECT * FROM STATION ORDER BY NAME"
Set rs = sys.DB.OpenRecordSet(strsql)
If Not (rs.BOF) Or (rs.EOF) Then
inum = 0
Do While Not rs.EOF
ReDim Preserve arrstation(1, inum)
arrstation(0, inum) = rs("ID")
arrstation(1, inum) = rs("NAME")
rs.MoveNext
inum = inum + 1
Loop
End If
'初始化客户
ReDim arrclient(1, 0)
strsql = "SELECT * FROM CLIENT ORDER BY NAME"
Set rs = sys.DB.OpenRecordSet(strsql)
If Not (rs.BOF) Or (rs.EOF) Then
inum = 0
Do While Not rs.EOF
ReDim Preserve arrclient(1, inum)
arrclient(0, inum) = rs("ID")
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页