我新建一个工程,加入一个DataModule,DataModule中只有一个adoyyb:TADOTABLE控件,实现其中一个方法如下:procedure TDataModule1.DataModuleCreate(Sender: TObject);
begin
adoyyb.ConnectionString :='Provider=OraOLEDB.Oracle.1;Password=yyb;Persist Security Info=True;User ID=yyb;Data Source=orayyb;Extended Properties=';
adoyyb.TableName :='ORDERS';
try
adoyyb.Open;
except
MessageBox(0,‘error’,MB_OK);
end;
end;为何运行老是出错,还要设置什么吗?
出错信息如下:
Project Project1.exe raised exception class EVariantError with
message 'Invalid variant operation'
请指点,谢谢!
begin
adoyyb.ConnectionString :='Provider=OraOLEDB.Oracle.1;Password=yyb;Persist Security Info=True;User ID=yyb;Data Source=orayyb;Extended Properties=';
adoyyb.TableName :='ORDERS';
try
adoyyb.Open;
except
MessageBox(0,‘error’,MB_OK);
end;
end;为何运行老是出错,还要设置什么吗?
出错信息如下:
Project Project1.exe raised exception class EVariantError with
message 'Invalid variant operation'
请指点,谢谢!
begin
adoyyb.ConnectionString :='Provider=OraOLEDB.Oracle.1;Password=yyb;Persist Security Info=True;User ID=yyb;Data Source=orayyb;Extended Properties=';
adoyyb.TableName :='yyb.ORDERS';
try
adoyyb.Open;
except
MessageBox(0,‘error’,MB_OK);
end;
end;如果改成这样还是没有辙,那就你的表名出了毛病
在Access2000中不用的啊。
2.tablename不需要在连接中指出,可以去掉,用的时候再加。
经过以上两部,应该没有错了,你试试