李维《系统篇》中第二章例子 DynamicSQLDemo的错误怎么解决呀?procedure TForm2.btnRunClick(Sender: TObject);
const
  sSQL : string = 'select * from ';
var
  sSelect : string;
begin
  if (PageControl1.ActivePageIndex = 0) then
  begin
    sSelect := sSQL + lbTables.Items[lbTables.ItemIndex];
    ClientDataSet1.Close;
    ClientDataSet1.CommandText := sSelect;
    ClientDataSet1.Open;    -----------》》这一句出错!
  end
  else错误提示为:
Project PDynamicSQLDemoClient.exe raised exception class EOleException
with message 'Missing Connection or ConnectionString',Prossstoped.Use 
Step Run to continue.其中DataSetProvider的OPTIONS属性已设为 poAllowCommandTex了!能动态执行
SQL语句时为什么会出现这个错误?大家学习时碰到没有?

解决方案 »

  1.   

    DataSetProvider 的Options 的poAllowCommandText属性设为真
      

  2.   

    和TDataSetProvider联结的数据集没有设置ConnectionString....
      

  3.   

    上次看错了。如果是D5的话或WIN98的话,装一个最新的MDAC试试。
    微软数据访问组件。也就是更新数据库驱动程序。
      

  4.   

    'Missing Connection or ConnectionString',Prossstoped.Use 
    Step Run to continue.
    设置TClientDataSet的 RemoteServer和DataSetprovider
      

  5.   

    UP,,,,,,,,,,,,
    出错速度快:没有定义connection
    否则connection.connectionstring有错
      

  6.   

    把例子发过来如何?[email protected]