我已经以编程方式为 Oracle 创建了基本 AM 对象(AMO),并且进展顺利,
要验证创建的组件,我正在使用 BIDS,当我从操作菜单中单击“探索数据”命令时,它会提示错误,
错误是
标题: OraOLEDB
未指定的错误:E_FAIL(0x80004005)
纽扣:
&重试
取消
我的代码如下
private string oraconString = @"Provider=OraOLEDB.Oracle;Data Source=( DESCRIPTION = ( ADDRESS_LIST = ( ADDRESS = ( PROTOCOL = TCP )( HOST = cmbtrndb02 )( PORT = 1521 ) ) )( CONNECT_DATA = ( SERVER = DEDICATED )( SERVICE_NAME = hector ) ) ); User Id= trnint16; Password = trnint16;";
static DataSourceView CreateDataSourceView(Database db, string strDataSourceName)
{
//Create the Datasource View
DataSourceView dsv = db.DataSourceViews.FindByName(strDataSourceName);
if (dsv != null)
dsv.Drop();
dsv = db.DataSourceViews.Add(strDataSourceName);
dsv.DataSourceID = strDataSourceName;
dsv.Schema = new DataSet();
dsv.Schema.Locale = CultureInfo.CurrentCulture;
//Open a connection to the DataSource
// Testing the oledb connection is working with ODP parameters
OleDbConnection connection = new OleDbConnection(dsv.DataSource.ConnectionString);
connection.Open();
#region Create tables
//Add table FACTITSLA
AddTable(dsv, connection, "FACTITSLA");
dsv.Update();
#endregion
return dsv;
}
这个错误的原因可能是什么?