请帮我看下,下面错在哪里了~~~感谢各位高手了mySQl = "delete from madmpeo where InfoNo='" & TxtInfID(2).Text & "'" & Chr(13) & _
              "insert into madmpeo(PeoNo,InfoNo,PeoName,PeoIDNO,PeoSex,PeoUnit,PeoOffice,PeoZW,WorkIDNo,OfficeTel,UnitAddr,MobileTel,MoveOldUnit,EatCardNo,CarCardNo,MoveBeginDate,MoveEndDate,WorkType,MoveFlag,EatCardType,CarUse,ISCityWorkFlag,OutInRights) " & Chr(13) & _
              "values('" & myPeoNo & "','" & TxtInfID(2).Text & "','" & txtName(10).Text & "','" & TxtIDcard(14).Text & "','" & TxtSex(24).Text & "','" & TxtDept(11).Text & "','" & TxtOffice(25).Text & "','" & TxtPeoZW(13).Text & "','" & TxtWordID(27).Text & "','" & TxtOfficetel(28).Text & "'" & _
              ", '" & TxtAddress(15).Text & "','" & TxtModelTel(29).Text & "','" & TxtOldoffice(30).Text & "','" & TxtInfID(0).Text & "','" & TxtInfID(1).Text & "','" & TxtLbl(2).Text & "-" & TxtLbl(37).Text & "-" & TxtLbl(38).Text & "','" & TxtLbl(39).Text & "-" & TxtLbl(10).Text & "-" & TxtLbl(13).Text & "'" & _
              ",'" & myWorkType & "','" & IIf(OptMoveFlag(0).Value = True, 1, 0) & "','" & myEatCardType & "','" & myCarUse & "','" & IIf(OptISCityWorkFlag(0).Value = True, 1, 0) & "','" & myOutInRights & "')"
            "insert into CardLed(PeoNo,CardDate,Memo)"& Chr(13) & _
            "values('" & myPeoNo & "','" & TxtCardDateY(0).Text & "-" & TxtCardDateM(0).Text & "-" & TxtCardDateD(0).Text & "','" & TxtCardDateY(1).Text & "-" & TxtCardDateM(1).Text & "-" & TxtCardDateD(1).Text & "','" & TxtCardDateY(2).Text & "-" & TxtCardDateM(2).Text & "-" & TxtCardDateD(2).Text & "','" & TxtCardDateY(3).Text & "-" & TxtCardDateM(3).Text & "-" & TxtCardDateD(3).Text & "','" & TxtCardDateY(4).Text & "-" & TxtCardDateM(4).Text & "-" & TxtCardDateD(4).Text & "','" & TxtMemo(0).Text &"')"& _
    strReturn = MyExecSQL(mySQl)

解决方案 »

  1.   

    mySQl = "delete from madmpeo where InfoNo='" & TxtInfID(2).Text & "'" & Chr(13) & _
                  "insert into madmpeo(PeoNo,InfoNo,PeoName,PeoIDNO,PeoSex,PeoUnit,PeoOffice,PeoZW,WorkIDNo,OfficeTel,UnitAddr,MobileTel,MoveOldUnit,EatCardNo,CarCardNo,MoveBeginDate,MoveEndDate,WorkType,MoveFlag,EatCardType,CarUse,ISCityWorkFlag,OutInRights) " & Chr(13) & _
                  "values('" & myPeoNo & "','" & TxtInfID(2).Text & "','" & txtName(10).Text & "','" & TxtIDcard(14).Text & "','" & TxtSex(24).Text & "','" & TxtDept(11).Text & "','" & TxtOffice(25).Text & "','" & TxtPeoZW(13).Text & "','" & TxtWordID(27).Text & "','" & TxtOfficetel(28).Text & "'" & _
                  ", '" & TxtAddress(15).Text & "','" & TxtModelTel(29).Text & "','" & TxtOldoffice(30).Text & "','" & TxtInfID(0).Text & "','" & TxtInfID(1).Text & "','" & TxtLbl(2).Text & "-" & TxtLbl(37).Text & "-" & TxtLbl(38).Text & "','" & TxtLbl(39).Text & "-" & TxtLbl(10).Text & "-" & TxtLbl(13).Text & "'" & _
                  ",'" & myWorkType & "','" & IIf(OptMoveFlag(0).Value = True, 1, 0) & "','" & myEatCardType & "','" & myCarUse & "','" & IIf(OptISCityWorkFlag(0).Value = True, 1, 0) & "','" & myOutInRights & "')"& chr(13)& _
                "insert into CardLed(PeoNo,CardDate,Memo)"& Chr(13) & _
                "values('" & myPeoNo & "','" & TxtCardDateY(0).Text & "-" & TxtCardDateM(0).Text & "-" & TxtCardDateD(0).Text & "','" & TxtCardDateY(1).Text & "-" & TxtCardDateM(1).Text & "-" & TxtCardDateD(1).Text & "','" & TxtCardDateY(2).Text & "-" & TxtCardDateM(2).Text & "-" & TxtCardDateD(2).Text & "','" & TxtCardDateY(3).Text & "-" & TxtCardDateM(3).Text & "-" & TxtCardDateD(3).Text & "','" & TxtCardDateY(4).Text & "-" & TxtCardDateM(4).Text & "-" & TxtCardDateD(4).Text & "','" & TxtMemo(0).Text &"')"& _
        strReturn = MyExecSQL(mySQl)
      

  2.   

    在程序运行过程中可以加以调试,觉得SQL有错可以DEBUG出来,放到数据的查询分析器中执行,那样容量调试出来。