S
Stephen Livesey
Hi,
I am having a problem developing a web service that is accessing data using
OLE or ODBC, however this problem is only occurring on 1 development PC
(mine), I have tested the same web service on other PC's and it works fine.
I have also written applications that use the same data providers and
perform the same queries, these applications work perfectly, I only get the
problem when using web services.
To test the problem, I have created new web service, this web service has
two methods, one using ODBC and the other using OLE, both methods perform
the same simple query as follows:
[WebMethod]
public DataSet GetDataSetUsingOdbc()
{
DataSet dataSet = new DataSet();
OdbcConnection odbcConnection = new
OdbcConnection("DSN=Temp5;UID=;NODE=;APPLICATION=");
OdbcDataAdapter odbcDataAdapter = new OdbcDataAdapter("select * from
expppgi",odbcConnection);
odbcDataAdapter.Fill(dataSet,"Table");
odbcConnection.Close();
if (dataSet != null)
{
return dataSet;
}
return null;
}
[WebMethod]
public DataSet GetDataSetUsingOle()
{
DataSet dataSet = new DataSet();
OleDbConnection oleDbConnection = new
OleDbConnection("Provider=CONNXOLEDB.1;Mode=ReadWrite;User ID=ste;Data
Source=c:\\connx32\\cdds\\temp5.cdd;Extended Properties=;Persist Security
Info=False;Location=");
OleDbDataAdapter oleDbDataAdapter = new OleDbDataAdapter("select * from
expppgi",oleDbConnection);
oleDbDataAdapter.Fill(dataSet,"Table");
oleDbConnection.Close();
if (dataSet != null)
{
return dataSet;
}
return null;
}
When I execute the Web Service and use the OLE method, the following error
is produced:
System.Data.OleDb.OleDbException: No error information available:
E_UNEXPECTED(0x8000FFFF). at
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) at
System.Data.OleDb.OleDbConnection.InitializeProvider() at
System.Data.OleDb.OleDbConnection.Open() at
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) at
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet
dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior) at
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at
ConnxTest.Service1.GetDataSetUsingOle() in
c:\inetpub\wwwroot\connxtest\service1.asmx.cs:line 80When I execute the Web
Service and use the ODBC method, the following error is produced:
System.NullReferenceException: Object reference not set to an instance of an
object. at System.Data.Common.Odbc32.SQLFreeHandle(Int16 HandleType,
HandleRef StatementHandle) at
System.Data.Odbc.DBCWrapper.CloseAndRelease() at
System.Data.Odbc.OdbcConnection.DisposeClose() at
System.Data.Odbc.OdbcConnection.Open() at
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) at
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet
dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior) at
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at
ConnxTest.Service1.GetDataSetUsingOdbc() in
c:\inetpub\wwwroot\connxtest\service1.asmx.cs:line 60
Both of the errors occur when the Fill command is being executed.
The PC is using Visual Studio 2003 and Windows XP Professional, I have also
installed MDAC v2.8 but this had no effect.
Thanks
Stephen Livesey
I am having a problem developing a web service that is accessing data using
OLE or ODBC, however this problem is only occurring on 1 development PC
(mine), I have tested the same web service on other PC's and it works fine.
I have also written applications that use the same data providers and
perform the same queries, these applications work perfectly, I only get the
problem when using web services.
To test the problem, I have created new web service, this web service has
two methods, one using ODBC and the other using OLE, both methods perform
the same simple query as follows:
[WebMethod]
public DataSet GetDataSetUsingOdbc()
{
DataSet dataSet = new DataSet();
OdbcConnection odbcConnection = new
OdbcConnection("DSN=Temp5;UID=;NODE=;APPLICATION=");
OdbcDataAdapter odbcDataAdapter = new OdbcDataAdapter("select * from
expppgi",odbcConnection);
odbcDataAdapter.Fill(dataSet,"Table");
odbcConnection.Close();
if (dataSet != null)
{
return dataSet;
}
return null;
}
[WebMethod]
public DataSet GetDataSetUsingOle()
{
DataSet dataSet = new DataSet();
OleDbConnection oleDbConnection = new
OleDbConnection("Provider=CONNXOLEDB.1;Mode=ReadWrite;User ID=ste;Data
Source=c:\\connx32\\cdds\\temp5.cdd;Extended Properties=;Persist Security
Info=False;Location=");
OleDbDataAdapter oleDbDataAdapter = new OleDbDataAdapter("select * from
expppgi",oleDbConnection);
oleDbDataAdapter.Fill(dataSet,"Table");
oleDbConnection.Close();
if (dataSet != null)
{
return dataSet;
}
return null;
}
When I execute the Web Service and use the OLE method, the following error
is produced:
System.Data.OleDb.OleDbException: No error information available:
E_UNEXPECTED(0x8000FFFF). at
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) at
System.Data.OleDb.OleDbConnection.InitializeProvider() at
System.Data.OleDb.OleDbConnection.Open() at
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) at
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet
dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior) at
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at
ConnxTest.Service1.GetDataSetUsingOle() in
c:\inetpub\wwwroot\connxtest\service1.asmx.cs:line 80When I execute the Web
Service and use the ODBC method, the following error is produced:
System.NullReferenceException: Object reference not set to an instance of an
object. at System.Data.Common.Odbc32.SQLFreeHandle(Int16 HandleType,
HandleRef StatementHandle) at
System.Data.Odbc.DBCWrapper.CloseAndRelease() at
System.Data.Odbc.OdbcConnection.DisposeClose() at
System.Data.Odbc.OdbcConnection.Open() at
System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection,
ConnectionState& originalState) at
System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32
startRecord, Int32 maxRecords, String srcTable, IDbCommand command,
CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet
dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand
command, CommandBehavior behavior) at
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at
ConnxTest.Service1.GetDataSetUsingOdbc() in
c:\inetpub\wwwroot\connxtest\service1.asmx.cs:line 60
Both of the errors occur when the Fill command is being executed.
The PC is using Visual Studio 2003 and Windows XP Professional, I have also
installed MDAC v2.8 but this had no effect.
Thanks
Stephen Livesey