VB数据表中插入数据错误:Data type mismatch
cn0.Execute "create table CJJT(编号 n(4) not null,阶段垂深 b(10) ,壁厚 b(10),环向配筋 b(10))"
rs0.Open "select * from CJJT", cn0
Dim num As Integer
num = rs0.RecordCount + 1
cn0.Execute "insert into CJJT values ( '" & num & "' ,'" & Val(h_t.Text) & "','" & Val(hz_t.Text) & "' ,'" & Val(Ax_t.Text) & "')"
我怎么找不出错来,希望高手们帮帮忙
[解决办法]
cno.execute "insert into 表名(字符型字段,数值型字段) values('"& 字符型变量 &"',"& 数值型变量 &")"
[解决办法]
如果是Access字段里有INT类型吧...插入的时候全是字符类型,那应该少单引用,
打印语句出来,放在查询分析器看下就OK.