Print Page | Close Window

Multiple-Step OLE DB Operation Errors....

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=11638
Printed Date: 29 March 2026 at 4:41am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Multiple-Step OLE DB Operation Errors....
Posted By: davidshq
Subject: Multiple-Step OLE DB Operation Errors....
Date Posted: 26 August 2004 at 10:55am

Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

My code-behind looks like this:
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Data
Imports System.Data.OleDb

Public Class BasicAuthorList
      Inherits Page

      Protected listAuthor as DataList
      ' Replaced Provider=SQLOLEDB.1 b/c it wasn't functioning.
      Private ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=localhost;Initial Catalog=pubs;Integrated Security=SSPI"

    Private Sub Page_Load (sender as Object, e as EventArgs) Handles MyBase.Load
      ' Create and fill a DataSet.
      Dim SQL as String
      SQL = "SELECT * FROM Authors"
      Dim con as New OleDbConnection(ConnectionString)
      Dim cmd as New OleDbCommand(SQL, con)
      Dim adapter as New OleDbDataAdapter(cmd)
      Dim Pubs as New DataSet()
      con.Open()
      adapter.Fill(Pubs, "Authors")
      con.Close()

      ' Bind the DataSet, and activate the data binds for the page.
      listAuthor.DataSource = Pubs.Tables("Authors")
      Me.DataBind()
    End Sub
End Class
Any ideas?
David.



-------------
- http://www.davemackey.net/" rel="nofollow - Dave Mackey - Virtual Home.



Replies:
Posted By: Mart
Date Posted: 26 August 2004 at 11:01am
On what line do you get the error?


Posted By: davidshq
Date Posted: 26 August 2004 at 11:16am
It doesn't give me a line...It just gives me a stack trace:
[OleDbException (0x80040e21): Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.]
System.Data.OleDb.OleDbConnection.ProcessResults(Int32 hr) +20
System.Data.OleDb.OleDbConnection.CreateProviderError(Int32 hr) +23
System.Data.OleDb.OleDbConnection.CreateProvider(OleDbConnec tionString constr) +81
System.Data.OleDb.OleDbConnection.Open() +203
BasicAuthorList.Page_Load(Object sender, EventArgs e) +112
System.Web.UI.Control.OnLoad(EventArgs e) +55
System.Web.UI.Control.LoadRecursive() +27
System.Web.UI.Page.ProcessRequestMain() +731



-------------
- http://www.davemackey.net/" rel="nofollow - Dave Mackey - Virtual Home.


Posted By: Mart
Date Posted: 26 August 2004 at 12:18pm

Why are you trying to connect to SQL Server with System.Data.OleDb?

Try this code: (not tested)

Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Data
Imports System.Data.SqlClient

Public Class BasicAuthorList
      Inherits Page

      Protected listAuthor as DataList
      ' Replaced Provider=SQLOLEDB.1 b/c it wasn't functioning.
      Private ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=localhost;Initial Catalog=pubs;Integrated Security=SSPI"

    Private Sub Page_Load (sender as Object, e as EventArgs) Handles MyBase.Load
      ' Create and fill a DataSet.
      Dim SQL as String
      SQL = "SELECT * FROM Authors"
      Dim con as New SqlConnection(ConnectionString)
      Dim cmd as New SqlCommand(SQL, con)
      Dim adapter as New SqlDataAdapter(cmd)
      Dim Pubs as New DataSet()
      con.Open()
      adapter.Fill(Pubs, "Authors")
      con.Close()

      ' Bind the DataSet, and activate the data binds for the page.
      listAuthor.DataSource = Pubs.Tables("Authors")
      Me.DataBind()
    End Sub
End Class



Posted By: davidshq
Date Posted: 26 August 2004 at 1:50pm
Hmmm...Well, I tried that and things looked hopeful but in the end it told me:
[ArgumentException: Keyword not supported: 'provider'.]
System.Data.Common.DBConnectionString.ParseInternal(Char[] connectionString, UdlSupport checkForUdl, NameValuePair& keychain) +1095
System.Data.Common.DBConnectionString..ctor(String connectionString, UdlSupport checkForUdl) +114
System.Data.SqlClient.SqlConnectionString..ctor(String connectionString) +13
System.Data.SqlClient.SqlConnectionString.ParseString(String connectionString) +87
System.Data.SqlClient.SqlConnection.set_ConnectionString(Str ing value) +11
System.Data.SqlClient.SqlConnection..ctor(String connectionString) +134
BasicAuthorList.Page_Load(Object sender, EventArgs e) +37
System.Web.UI.Control.OnLoad(EventArgs e) +55
System.Web.UI.Control.LoadRecursive() +27
I think that perhaps the problem is with the database and not with the code? Just a thought? Is there any way for me to figure out if maybe its just having problems connecting to pubs?
System.Web.UI.Page.ProcessRequestMain() +731



-------------
- http://www.davemackey.net/" rel="nofollow - Dave Mackey - Virtual Home.


Posted By: Mart
Date Posted: 26 August 2004 at 2:43pm

its just the connection string that is wrong, try this one

Server=localhost;User ID=sa;Password=password;Database=Pubs;



Posted By: Bunce
Date Posted: 27 August 2004 at 12:59am

I think the first thing that needs to be asked is:

What database are you trying to connect to?



-------------
There have been many, many posts made throughout the world...
This was one of them.


Posted By: davidshq
Date Posted: 27 August 2004 at 9:33am
I am attempting to connect to the pubs database. I have replaced the code as you suggested Mart, but now its telling me:
Keyword not supported 'provider.'
I believe this is talkiing about
Private ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Server=localhost;User ID=sa;Password=password;Database=pubs"
David.


-------------
- http://www.davemackey.net/" rel="nofollow - Dave Mackey - Virtual Home.


Posted By: davidshq
Date Posted: 27 August 2004 at 9:45am
I did some research and found that I can just remove the Provider string, so I've done that. Its still throwing an error, and I'm about to go research it, but I'll post it here in case anyone has any quick ideas:
SQL Server does not exist or access is denied.
I don't have SQL Server, I do have MSDE?
David.


-------------
- http://www.davemackey.net/" rel="nofollow - Dave Mackey - Virtual Home.


Posted By: Mart
Date Posted: 27 August 2004 at 10:19am
Instead of Server=localhost use Server=(local)... MSDE doesn't support localhost


Posted By: davidshq
Date Posted: 27 August 2004 at 10:27am
Beautiful Mart. Someday when I am rich and famous I will have to remember to tell everyone how I was aided time and again by Mart at Web Wiz.
David.


-------------
- http://www.davemackey.net/" rel="nofollow - Dave Mackey - Virtual Home.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net