我遇到这样的问题:
在编辑器上定义了一个SQL 语句如下:
strSQL = "Select distinct A.ProductCD ,A.Edaban,A.AMFlag ," _
& "A.CompoNo,A.CompoCD,A.AMFlag,A.MixtureRatio,A.UnitCD, " _
& "A.CompoTankNo ,A.JIT ,A.CreateDate ,A.UpdateDate ," _
& "A.MinTemperature ,A.MaxTemperature ,convert(Char(20),A.MixTime,8) as MixTime, " _
& "A.CreateDateTime ,A.UpdateDateTime,B.ProductName as ProductNM," _
& "d.ProductName as CompoundNM " _
& " from CompoundCompMaster A,ProductMaster B,ProductPackingMaster C, " _
& "ProductMaster D" _
& " where A.ProductCD='" _
& dtg_CompoundComp.Columns(0).Text & "'" _
& " and A.Edaban='" _
& dtg_CompoundComp.Columns(1).Text & "'" _
& " and substring(convert(Char(20), A.CreateDate,20),0,11)= '" _
& dtg_CompoundComp.Columns(2).Text & "'" _
& " and substring(convert(Char(20),A.UpdateDate,20),0,11) = '" _
& dtg_CompoundComp.Columns(3).Text & "'" _
& " and A.MinTemperature = '" _
& dtg_CompoundComp.Columns(4).Text & "'" _
& " and A.MaxTemperature = '" _
& dtg_CompoundComp.Columns(5).Text & "'" _
& " and convert(Char(20),A.MixTime,8) = '" _
& dtg_CompoundComp.Columns(6).Text & "'" _
& " and A.ProductCD=B.ProductNO and A.CompoCD=C.ProductCD " _
& " and C.ProductCD=D.ProductNO " _
& ""
在想连接字符时提示:too many line continuations
不知道是不是可以设置一下,可以多接几行字符串
在编辑器上定义了一个SQL 语句如下:
strSQL = "Select distinct A.ProductCD ,A.Edaban,A.AMFlag ," _
& "A.CompoNo,A.CompoCD,A.AMFlag,A.MixtureRatio,A.UnitCD, " _
& "A.CompoTankNo ,A.JIT ,A.CreateDate ,A.UpdateDate ," _
& "A.MinTemperature ,A.MaxTemperature ,convert(Char(20),A.MixTime,8) as MixTime, " _
& "A.CreateDateTime ,A.UpdateDateTime,B.ProductName as ProductNM," _
& "d.ProductName as CompoundNM " _
& " from CompoundCompMaster A,ProductMaster B,ProductPackingMaster C, " _
& "ProductMaster D" _
& " where A.ProductCD='" _
& dtg_CompoundComp.Columns(0).Text & "'" _
& " and A.Edaban='" _
& dtg_CompoundComp.Columns(1).Text & "'" _
& " and substring(convert(Char(20), A.CreateDate,20),0,11)= '" _
& dtg_CompoundComp.Columns(2).Text & "'" _
& " and substring(convert(Char(20),A.UpdateDate,20),0,11) = '" _
& dtg_CompoundComp.Columns(3).Text & "'" _
& " and A.MinTemperature = '" _
& dtg_CompoundComp.Columns(4).Text & "'" _
& " and A.MaxTemperature = '" _
& dtg_CompoundComp.Columns(5).Text & "'" _
& " and convert(Char(20),A.MixTime,8) = '" _
& dtg_CompoundComp.Columns(6).Text & "'" _
& " and A.ProductCD=B.ProductNO and A.CompoCD=C.ProductCD " _
& " and C.ProductCD=D.ProductNO " _
& ""
在想连接字符时提示:too many line continuations
不知道是不是可以设置一下,可以多接几行字符串
strSQL =strSQL & & dtg_CompoundComp.Columns(3).Text & "'"
就可以了。上面的写法时编辑器设置的。