我的环境:delphi7、sqlserver2000、通过ODBC建立连接数据库,用ADOQUERY查询,
查询语句如下:
Select a.TNumber,a.TName,a.TState,a.EndTime, a.OpenCount, IsNull(b.PreNo,'') PreNo From a  Left outer Join 
(SELECT PreNo 
FROM c 
where PreDateTime='2007-06-19' and PSta=1 and PClass='IO')  b 
on a.TNumber=b.PreNo ,c 
Where a.TypeNo= c.TypeNo 
And c.Qno='101001' 
Order By a.TNumber
程序运行后第一次打开没有问题,在运行的过程中如果再一次Open上面的查询就报错“Project **.exe raised exception class EOLeException with message '[Microsoft][ODBC SQL Server Driver]字符串数据,右截位'.Process stopped.Use Step or Run to continue”。
望各位大侠指点。如果不加里面的select嵌套查询则不报错。