Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Multiple-Step OLE DB Operation Errors....
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Multiple-Step OLE DB Operation Errors....

 Post Reply Post Reply Page  12>
Author
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post Topic: Multiple-Step OLE DB Operation Errors....
    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.

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 26 August 2004 at 11:01am
On what line do you get the error?
Back to Top
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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;

Back to Top
Bunce View Drop Down
Senior Member
Senior Member
Avatar

Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bunce Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
davidshq View Drop Down
Senior Member
Senior Member


Joined: 29 July 2003
Location: United States
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote davidshq Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.