vb 好像是常见的错误 看了半天没有看出来那个地方出错了。
For i = 1 To countt
If rs2.EOF = False Then
csbhstr = rs2.Fields(0).Value
End If
Call liucode(code)
strstr = "INSERT INTO purapp VALUES(" & psbh.Text & "," & code & "," & csbhstr & ","",0,0,0," & jhpz.Text & "," & hbyq.Text & "," & jhjd.Text & "," & jgqk.Text & "," & phd.Text & "," & jfzd.Text & "," & ceyf.Text & "," & fwpz.Text & "," & fwjd.Text & "," & phd2.Text & "," & ceyf2.Text & ",'" & Trim(jlz.Text) & "','" & jlrq.Text & "')"
conn2.Execute (strstr)
Next i
红色的报错 run-time error '424' object required
大侠们研究一下。。TKS 查看 psbh.Text 类的,*.Text的控件是否都存在。
strstr = "INSERT INTO purapp VALUES(" & psbh.Text & "," & code & "," & csbhstr & ","",0,0,0," & jhpz.Text & "," & hbyq.Text & "," & jhjd.Text & "," & jgqk.Text & "," & phd.Text & "," & jfzd.Text & "," & ceyf.Text & "," & fwpz.Text & "," & fwjd.Text & "," & phd2.Text & "," & ceyf2.Text & ",'" & Trim(jlz.Text) & "','" & jlrq.Text & "')"
错误提示说的很明显了,对象不存在。这里有十几个文本框,你是从人家那复制的代码吧,看懂了再用。 str=" INSERT INTO 表名(字符型字段名,数据型字段名) VALUES('"& 字符型变量 &"',"& 数值型变量 &")"
应该是某个textbox控件不存在或者是名称写错 这个光看看不出来的,断点debug
补充:VB , 数据库(包含打印,安装,报表)