| 发表于:2008-01-18 21:42:4516楼 得分:0 |
这为兄弟,我照着你提供的样式,试了一下,还是不行嘛!真的郁闷死了,也不知道是我特别苯还是怎么的。我将我的代码贴出来,请您再帮忙看看啊! cnn.EXECute ("insert into spxsb(ckzlid,wsttzlid,khzlid,xsbbh,qsbh,fphm,yfpsfxf,djxfdr,djxfsj,rq,hjje,bz,zdr)values " & _ "(" + str(text1.text) + "," + str(text2.text) + "," + str(text3.text) + "," & _ "'" + trim(right(left(trim(label5.caption), 15), 11)) + "'," & _ "'" & text9.text & "'," & _ "'" & text12.text & "'," & _ "" & iif(check1.value = 0, "0", " -1 ") & "," & _ "'" & label7.caption & "'," & _ "" & iif(not isdate(label8.caption), "null", "#" & label8.caption & "#") & "," & _ "" & iif(not isdate(dtpicker1.value), "null", "#" & dtpicker1.value & "#") & "," & _ "" & iif(trim(mshflexgrid2.textmatrix(0, 3)) = "", "null", trim(mshflexgrid2.textmatrix(0, 3))) & "," & _ "'" & iif(trim(text8.text) = "", null, trim(text8.text)) & "','" + trim(label6.caption) + "')"), i dim rst as adodb.recordset set rst = new adodb.recordset rst.open "select @@identity as myid from spxsb ", cnn, adopenstatic, adlockoptimistic msgbox rst.fields("myid") '这里rst(0)即为新记录的自动编号字段的值。 您看,我那里写的不对呢?都照着你的样式写的了,可 msgbox 函数返回的值依然是0。急死了。 | | |
|