有下面一行代码后续还有往里面加,但因一行太长写不下了,问问怎样换行
   ps:空格+下划线和 %+空格+下划线都试过了,但还是不行啊。
Set AdoRs =Cnn.Execute("insert into Data(Code1,Code2,Code3,Code4,Code5,Code6,Code7,Code8,Code9,Code10,Code11,Code12,Code13,Code14,Code15,Code16,Code17,Code18,Code19,Code20,Code21,Code22,Code24,Code25,Code26,Code27,Code28,Code29,Code30,Code31,Code32,Code33,Code34,Code35,Code36,Code37,Code38,Code39,Code40) values('" & Text1(1) & "','" & Text1(2) & "','" & Text1(3) & "','" & Text1(4) & "','" & Text1(5) & "','" & Text1(6) & "','" & Text1(7) & "','" & Text1(8) & "','" & Text1(9) & "','" & Text1(10) & "','" & Text1(11) & "','" & Text1(12) & "','" & Text1(13) & "','" & Text1(14) & "','" & Text1(15) & "','" & Text1(16) & "','" & Text1(17) & "','" & Text1(18) & "','" & Text1(19) & "','" & Text1(20) & "','" & Text1(21) & "','" & Text1(22) & "','" & Text1(23) & "','" & Text1(24) & "','" & Text1(25) & "','" & Text1(26) & "','" & Text1(27) & "','" & Text1(28) & "','" & Text1(29) & "','" & Text1(30) & "','" & Text1(31) & "','" & Text1(32) & "','" & Text1(33) & "'," & Text1(34) & "','" & Text1(35) & "','" & Text1(36) & "','" & Text1(37) & "','" & Text1(38) & "','" & Text1(39) & "','" & Text1(40) & "')")

解决方案 »

  1.   

    strP="hahaha" & _
         "hahah"
      

  2.   


    strP="hahaha"  _
     & "hahah"
      

  3.   

    建议将字符串保存到一个变量中。dim s$
    s=Text1(1) & "','" & Text1(2) & "','" & Text1(3) & "','" & Text1(4) & "','" & Text1(5) & "','" & Text1(6) & "','" & Text1(7) & "','" & Text1(8) & "','" & Text1(9) & "','" & Text1(10) & "','" & Text1(11) & "','" & Text1(12) & "','" & Text1(13) & "','" & Text1(14) & "','" & Text1(15) & "','" & Text1(16) & "','" & Text1(17) & "','" & Text1(18) & "','" & Text1(19) & "','" & Text1(20) & "','" & Text1(21) & "','" & Text1(22) & "','" & Text1(23) & "','" & Text1(24) & "','" & Text1(25) & "','" & Text1(26) & "','" & Text1(27) & "','" & Text1(28) & "','" & Text1(29) & "','" & Text1(30) & "','" & Text1(31) & "','" & Text1(32) & "','" & Text1(33) & "'," & Text1(34) & "','" & Text1(35) & "','" & Text1(36) & "','" & Text1(37) & "','" & Text1(38) & "','" & Text1(39) & "','" & Text1(40) & "')"如果用 s="x" & _最多只能三十几行貌似,可以转换成
    s="xx"
    s=s & "xxx"这样的形式。其实对于你上面的text1控件数组完全可以用一个循环搞定。dim i%,s$
    for i=1 to 40
      s=s & text1(i).text & "','"
    nextmsgbox s
    看看s内容,然后加上前后缀组成即可。
      

  4.   

    你不要写那么长
        Dim sSql As String
        sSql = "update baby_yq set "
        sSql = sSql & "概况 = '" & sGH
        sSql = sSql & "',身体变化 = '" & sBody
        sSql = sSql & "',子宫中的胎儿 = '" & sBaby
        sSql = sSql & "',营养与饮食 = '" & sEat
        sSql = sSql & "',专家指导 = '" & sZJ
        sSql = sSql & "',特别提醒 = '" & sWarn
        sSql = sSql & "',胎教 = '" & sTJ
        sSql = sSql & "',生活保健 = '" & sLife
        sSql = sSql & "',心理调适 = '" & sHeart & "'"
      

  5.   

    多写几个
    sSql = sSql & " "