yp.Open "select * from 3孔药", Cnn, adOpenKeyset, adLockOptimistic
yp.AddNew
yp.Fields("批号") = Text3.Text 批号的保存也应该是个问题
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''第1行
yp.Fields("hh1") = MSFGrid1.TextMatrix(1, 1) & ""
yp.Fields("kj1") = MSFGrid1.TextMatrix(1, 2) & ""
yp.Fields("hh2") = MSFGrid1.TextMatrix(1, 3) & ""
yp.Fields("kj2") = MSFGrid1.TextMatrix(1, 4) & ""
yp.Fields("hh3") = MSFGrid1.TextMatrix(1, 5) & ""
yp.Fields("kj3") = MSFGrid1.TextMatrix(1, 6) & ""
yp.Fields("hh4") = MSFGrid1.TextMatrix(1, 7) & ""
yp.Fields("kj4") = MSFGrid1.TextMatrix(1, 8) & ""
yp.Fields("hh5") = MSFGrid1.TextMatrix(1, 9) & ""
yp.Fields("kj5") = MSFGrid1.TextMatrix(1, 10) & ""
yp.Fields("hh6") = MSFGrid1.TextMatrix(1, 11) & ""
。。
。。
。。
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''第30行
yp.Fields("hh1") = MSFGrid1.TextMatrix(30, 1) & ""
yp.Fields("kj1") = MSFGrid1.TextMatrix(30, 2) & ""
yp.Fields("hh2") = MSFGrid1.TextMatrix(30, 3) & ""
yp.Fields("kj2") = MSFGrid1.TextMatrix(30, 4) & ""
yp.Fields("hh3") = MSFGrid1.TextMatrix(30, 5) & ""
yp.Fields("kj3") = MSFGrid1.TextMatrix(30, 6) & ""
yp.Fields("hh4") = MSFGrid1.TextMatrix(30, 7) & ""
yp.Fields("kj4") = MSFGrid1.TextMatrix(30, 8) & ""
yp.Fields("hh5") = MSFGrid1.TextMatrix(30, 9) & ""
yp.Fields("kj5") = MSFGrid1.TextMatrix(30, 10) & ""
yp.Fields("hh6") = MSFGrid1.TextMatrix(30, 11) & "" yp.Update
yp.Close
yp.AddNew
yp.Fields("批号") = Text3.Text 批号的保存也应该是个问题
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''第1行
yp.Fields("hh1") = MSFGrid1.TextMatrix(1, 1) & ""
yp.Fields("kj1") = MSFGrid1.TextMatrix(1, 2) & ""
yp.Fields("hh2") = MSFGrid1.TextMatrix(1, 3) & ""
yp.Fields("kj2") = MSFGrid1.TextMatrix(1, 4) & ""
yp.Fields("hh3") = MSFGrid1.TextMatrix(1, 5) & ""
yp.Fields("kj3") = MSFGrid1.TextMatrix(1, 6) & ""
yp.Fields("hh4") = MSFGrid1.TextMatrix(1, 7) & ""
yp.Fields("kj4") = MSFGrid1.TextMatrix(1, 8) & ""
yp.Fields("hh5") = MSFGrid1.TextMatrix(1, 9) & ""
yp.Fields("kj5") = MSFGrid1.TextMatrix(1, 10) & ""
yp.Fields("hh6") = MSFGrid1.TextMatrix(1, 11) & ""
。。
。。
。。
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''第30行
yp.Fields("hh1") = MSFGrid1.TextMatrix(30, 1) & ""
yp.Fields("kj1") = MSFGrid1.TextMatrix(30, 2) & ""
yp.Fields("hh2") = MSFGrid1.TextMatrix(30, 3) & ""
yp.Fields("kj2") = MSFGrid1.TextMatrix(30, 4) & ""
yp.Fields("hh3") = MSFGrid1.TextMatrix(30, 5) & ""
yp.Fields("kj3") = MSFGrid1.TextMatrix(30, 6) & ""
yp.Fields("hh4") = MSFGrid1.TextMatrix(30, 7) & ""
yp.Fields("kj4") = MSFGrid1.TextMatrix(30, 8) & ""
yp.Fields("hh5") = MSFGrid1.TextMatrix(30, 9) & ""
yp.Fields("kj5") = MSFGrid1.TextMatrix(30, 10) & ""
yp.Fields("hh6") = MSFGrid1.TextMatrix(30, 11) & "" yp.Update
yp.Close
解决方案 »
- VB中MSHFlexGrid不能全部显示access表中数据?
- vb 关机问题,高手速度进,谢谢啊
- 怎么将数据存储在Excel中,求代码
- VB如何判断本机局域网映射盘符失效?
- LISTBOX中如何显示随机文件里的字符,字符定义为string
- 菜鸟求问高手:VB能实现对某网页信息监控,当符合某一条件时,模拟鼠标点击的功能么?
- 将程序的置于任务栏的最右边像输入法那样
- crystalreport控件问题?
- 怎么找到QQ对战平台的房间句柄?
- 如何通过自已的程序向网站提交所需信息?(已有HTML代码)
- rstemp.Fields("FAmount2")
- Set xls = xlApp.ActiveSheet,xls是什么数据类型(或变量)?
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''第1行
for i=1 to 30
yp.AddNew
yp.Fields("hh1") = MSFGrid1.TextMatrix(i, 1) & ""
yp.Fields("kj1") = MSFGrid1.TextMatrix(i, 2) & ""
yp.Fields("hh2") = MSFGrid1.TextMatrix(i, 3) & ""
yp.Fields("kj2") = MSFGrid1.TextMatrix(i, 4) & ""
yp.Fields("hh3") = MSFGrid1.TextMatrix(i, 5) & ""
yp.Fields("kj3") = MSFGrid1.TextMatrix(i, 6) & ""
yp.Fields("hh4") = MSFGrid1.TextMatrix(i, 7) & ""
yp.Fields("kj4") = MSFGrid1.TextMatrix(i, 8) & ""
yp.Fields("hh5") = MSFGrid1.TextMatrix(i, 9) & ""
yp.Fields("kj5") = MSFGrid1.TextMatrix(i, 10) & ""
yp.Fields("hh6") = MSFGrid1.TextMatrix(i, 11) & ""
next iyp.update
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''第1行
for i=1 to 30
yp.AddNew
yp.Fields("批号") = Text3.Text & format(i,"00") ' 批号的保存也应该是个问题
yp.Fields("hh1") = MSFGrid1.TextMatrix(i, 1) & ""
yp.Fields("kj1") = MSFGrid1.TextMatrix(i, 2) & ""
yp.Fields("hh2") = MSFGrid1.TextMatrix(i, 3) & ""
yp.Fields("kj2") = MSFGrid1.TextMatrix(i, 4) & ""
yp.Fields("hh3") = MSFGrid1.TextMatrix(i, 5) & ""
yp.Fields("kj3") = MSFGrid1.TextMatrix(i, 6) & ""
yp.Fields("hh4") = MSFGrid1.TextMatrix(i, 7) & ""
yp.Fields("kj4") = MSFGrid1.TextMatrix(i, 8) & ""
yp.Fields("hh5") = MSFGrid1.TextMatrix(i, 9) & ""
yp.Fields("kj5") = MSFGrid1.TextMatrix(i, 10) & ""
yp.Fields("hh6") = MSFGrid1.TextMatrix(i, 11) & ""
next i yp.update
For i = 1 To 30
yp.AddNew
yp.Fields("批号") = Text3.Text & Format(i, "00")
For j = 1 To 11
yp.Fields(Array("kj", "hh")(j Mod 2) & (j + 1) \ 2) = MSFGrid1.TextMatrix(i, j) & ""
Next
yp.Update
Next
多点几下保存 在数据库里只是增加了几行空的数据啊
我用的是access数据库
With MSFGrid1
For i = 1 To .Rows
.Row = i
If (.TextMatrix(i, 1) & "") <> "" Then '假如这行有数据,则这列必定有数据
yp.AddNew
yp.Fields("批号") = Text3.Text & Format(i, "00") ' 批号的保存也应该是个问题
yp.Fields("hh1") = .TextMatrix(i, 1) & ""
yp.Fields("kj1") = .TextMatrix(i, 2) & ""
yp.Fields("hh2") = .TextMatrix(i, 3) & ""
yp.Fields("kj2") = .TextMatrix(i, 4) & ""
yp.Fields("hh3") = .TextMatrix(i, 5) & ""
yp.Fields("kj3") = .TextMatrix(i, 6) & ""
yp.Fields("hh4") = .TextMatrix(i, 7) & ""
yp.Fields("kj4") = .TextMatrix(i, 8) & ""
yp.Fields("hh5") = .TextMatrix(i, 9) & ""
yp.Fields("kj5") = .TextMatrix(i, 10) & ""
yp.Fields("hh6") = .TextMatrix(i, 11) & ""
yp.Update
End If
Next i
End With
yp.Open "select * from 3孔药", Cnn, adOpenKeyset, adLockOptimistic
With MSFGrid1
For i = 1 To .Rows - 1
.Row = i
If (.TextMatrix(i, 1) & "") <> "" Then '假如这行有数据,则这列必定有数据
yp.AddNew
yp.Fields("批号") = Text3.Text & Format(i, "00") ' 批号的保存也应该是个问题
yp.Fields("hh1") = .TextMatrix(i, 1) & ""
yp.Fields("kj1") = .TextMatrix(i, 2) & ""
yp.Fields("hh2") = .TextMatrix(i, 3) & ""
yp.Fields("kj2") = .TextMatrix(i, 4) & ""
yp.Fields("hh3") = .TextMatrix(i, 5) & ""
yp.Fields("kj3") = .TextMatrix(i, 6) & ""
yp.Fields("hh4") = .TextMatrix(i, 7) & ""
yp.Fields("kj4") = .TextMatrix(i, 8) & ""
yp.Fields("hh5") = .TextMatrix(i, 9) & ""
yp.Fields("kj5") = .TextMatrix(i, 10) & ""
yp.Fields("hh6") = .TextMatrix(i, 11) & ""
yp.Update
End If
Next i
End With
With MSFGrid1
.rows=yp.recordcount+1
while not yp.eof
i=i+1 .TextMatrix(i, 1) = yp.Fields("hh1") & ""
.TextMatrix(i, 2) = yp.Fields("kj1") & ""
……
yp.movenext
End If
wend
End With
end if
yp.close