cn.Execute "insert into lesson(qid,chinesename,datetime,order,shift,num,sort,content,causea,causeb,manage,Immediately,forever) values"('" & txtID.Text & "','" & lblName.Caption & "','" & dtpDatetime.Value & "','" & cboOrder.Text & "','" & cboShift.Text & "','" & txtNum.Text & "','" & cboSort.Text,'" & rtxtContent.Text & "','" & rtxtCauseA.Text & "','" & rtxtCauseB.Text & "','" & rtxtManage.Text & "','" & rtxtImmediately & "','" & rtxtForever.Text & "')"
请帮忙看看哪有问题,谢谢

解决方案 »

  1.   

    SQL语句好像没什么问题,你看看对象的值是否符合要求。
      

  2.   

    cn.Execute "insert into lesson(qid,chinesename,datetime,order,shift,num,sort,content,causea,causeb,manage,Immediately,forever) values('" & txtID.Text & "','" & lblName.Caption & "','" & dtpDatetime.Value & "','" & cboOrder.Text & "','" & cboShift.Text & "','" & txtNum.Text & "','" & cboSort.Text & "','" & rtxtContent.Text & "','" & rtxtCauseA.Text & "','" & rtxtCauseB.Text & "','" & rtxtManage.Text & "','" & rtxtImmediately & "','" & rtxtForever.Text & "')"Values 后面多了一个双引号。cboSort.Text 后面少 [& "',]。