System.Data.OleDb.OleDbException: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
-
Wednesday, February 13, 2013 11:34 AM
Code:
[WebMethod]
public string[] FeaturedGames()
{
OleDbConnection connection2 = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source=C:\\Temp\\GamesDatabase.accdb");
connection2.Open();
OleDbCommand cmd = new OleDbCommand("Select count(Game_ID) from Game_Feedback where Rating > 7", connection2);
OleDbDataReader reader = cmd.ExecuteReader();
reader.Read();
int NumOfFeatured = reader.GetInt32(0);
reader.Close();
String[] GameID = new string[NumOfFeatured];
cmd = new OleDbCommand("Select Game_ID from Game_Feedback where Rating > 7", connection2);
reader = cmd.ExecuteReader();
reader.Read();
int i = 0;
while (reader.Read())
{
GameID[i] = reader.GetString(0);
i++;
}
reader.Close();
cmd = new OleDbCommand("Select Count(Game_Title) from Game_Overview where Game_ID=@Game_ID", connection2);
cmd.Parameters.AddWithValue("@Game_ID", GameID);
reader = cmd.ExecuteReader();
reader.Read();
int numberofgames = reader.GetInt32(0);
reader.Close();
String[] GameTitle = new string[numberofgames];
cmd = new OleDbCommand("Select Game_Title from Game_Overview where Game_ID=@Game_ID", connection2);
cmd.Parameters.AddWithValue("@Game_ID", GameID);
reader = cmd.ExecuteReader();
int j = 0;
while (reader.Read())
{
GameTitle[j] = reader.GetString(0);
j++;
}
reader.Close();
connection2.Close();
return GameTitle;Error Code:
System.Data.OleDb.OleDbException: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.OleDb.OleDbCommand.ExecuteReader() at GamesWebService.Service1.FeaturedGames() in C:\Users\Jereld\Documents\Visual Studio 2010\Projects\GamesWebServiceBackup\GamesWebService\Service1.asmx.cs:line 148
All Replies
-
Wednesday, February 13, 2013 2:25 PMthis is not the correct forum because you access an MS Access db but not a SQL Server DB
Uwe Ricken
MCSE - SQL Server 2012
MCSA - SQL Server 2012
MCITP Database Administrator 2005
MCITP Database Administrator 2008
MCITP Microsoft SQL Server 2008, Database Development
db Berater GmbH
http://www-db-berater.de
SQL Server Blog (german only) -
Tuesday, February 19, 2013 8:18 AMModerator
Hi JTYR2,
The following are two possible causes of this error:- In the registry, under the key for an OLE DB provider's CLSID, there may be an entry named OLEDB_SERVICES. If the OLE DB provider that is used to make the ADO connection does not have the OLEDB_SERVICES entry, and ADO tries to set up a property that is not supported by the provider, the error occurs. For more information about this registry entry, see the "Resolution" section.
- If OLEDB_SERVICES entry exists but there is a problem in the ADO connection string, the error occurs.
Please refer to this article to troubleshoot your issue:
http://support.microsoft.com/kb/269495
If you are connecting to Access database, please visit Access forum since this forum is for SQL Server.
http://social.msdn.microsoft.com/Forums/en-US/accessdev/threads
Iric Wen
TechNet Community Support- Marked As Answer by Iric WenModerator Thursday, February 21, 2013 9:30 AM



