如何把这句话写成几行去,太长了
sComm.CommandText = "insert into tab_design(标题,操作表,界面名称,ctltype,ctlleft,ctltop,ctlheight,ctlwidth,ctlcaption,日期型) values('" & strtitle & "','" & strtabname & "','" & Trim(Text2.Text) & "','" & TypeName(Controls(i)) & "'," & Controls(i).Left & "," & Controls(i).Top & "," & Controls(i).Height & "," & Controls(i).Width & ",'" & Controls(i).Caption & "',0)"

解决方案 »

  1.   

    用 & _ 来换行就行了;或 sComm.CommandText = sComm.CommandText  & "....."
    a = "aaaa" & _
        "bbbb"
      

  2.   

    dim ss(3) as string
    ss(0) = "insert into tab_design(标题,操作表,界面名称,ctltype,ctlleft,ctltop,ctlheight,ctlwidth,ctlcaption,日期型) values('" 
    ss(1) = strtitle & "','" & strtabname & "','" & Trim(Text2.Text) & "','" & TypeName(Controls(i)) 
    ss(2) = "'," & Controls(i).Left & "," & Controls(i).Top & "," & Controls(i).Height & "," 
    ss(3) = Controls(i).Width & ",'" & Controls(i).Caption & "',0)"sComm.CommandText = ss(0) & ss(1) & ss(2) & ss(3)