请问VB中MSFlexGrid中保存多行数据至数据库的问题

来源:百度知道 编辑:UC知道 时间:2024/05/24 01:49:29
请问各位高手,我运行以下代码后,仍然不能把MSFlexGrid控件中的第一排数据存入指定的数据库中,这是为什么呢?

Visual Basic Language
----------------------
Public adoCon As New ADODB.Connection
Public adoRs As New ADODB.Recordset

temp = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\database\db_htgl.mdb;Persist Security Info=False"

adoCon.Open (temp)

Set adoRs = adoCon.Execute("insert into [Table_htxxb] values('" & MSF1.TextMatrix(1, 1) & "','" & MSF1.TextMatrix(1, 2) & "','" & MSF1.TextMatrix(1, 3) & "','" & MSF1.TextMatrix(1, 4) & "','" & MSF1.TextMatrix(1, 5) & "','" & MSF1.TextMatrix(1, 6) & "','" & MSF1.TextMatrix(1, 7) & "','" & MSF1.TextMatrix(1, 8) & "','" & MSF1.TextMatrix(1, 9) & "','" & MSF1.TextMatrix(1, 10) & "','" & MSF1.TextMatrix(

我记得
MSFlexGrid
不支持ADO数据记录集

用带个H的
MSHFlexGrid试试

另外把你报错信息发出来吧

建议你换个方法添加数据
adoRs.open "select * from Table_htxxb",adoCon,1,3

adoRs.addnew
adoRs.fields("列名")=值
adoRs.update