Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. DAAB wrapper issues with MS Access

DAAB wrapper issues with MS Access

Scheduled Pinned Locked Moved Visual Basic
databasehelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shreekar
    wrote on last edited by
    #1

    Hi, I am trying to write a wrapper for the DAAB in Ent Lib 2.0 since I have to use MS Access. As usual, I am facing hurdles right at the start. When I try to return the data reader from the wrapper class, I get the error "connection not initialised". I am using the Generic Database class. The relevant code is posted below: Dim objCommand As DbCommand Try Dim db As Microsoft.Practices.EnterpriseLibrary.Data.Database db = New GenericDatabase(ConnectionString, DBProvider) 'db.CreateConnection.Open() objCommand = db.GetSqlStringCommand(strSQL) error here --> Dim dr As IDataReader = objCommand.ExecuteReader() 'Dim dr As IDataReader = db.ExecuteReader(strSQL) Return dr I get the error: Connection property has not been initialised. I have tried with opening the connection, getting the datareader directly etc., but still the same error. And yes, the connectionstring is correct. The provider I am using is OleDB.OledBFactory.Instance. Any help/guidance on this is really appreciated. Shreekar

    M 1 Reply Last reply
    0
    • S shreekar

      Hi, I am trying to write a wrapper for the DAAB in Ent Lib 2.0 since I have to use MS Access. As usual, I am facing hurdles right at the start. When I try to return the data reader from the wrapper class, I get the error "connection not initialised". I am using the Generic Database class. The relevant code is posted below: Dim objCommand As DbCommand Try Dim db As Microsoft.Practices.EnterpriseLibrary.Data.Database db = New GenericDatabase(ConnectionString, DBProvider) 'db.CreateConnection.Open() objCommand = db.GetSqlStringCommand(strSQL) error here --> Dim dr As IDataReader = objCommand.ExecuteReader() 'Dim dr As IDataReader = db.ExecuteReader(strSQL) Return dr I get the error: Connection property has not been initialised. I have tried with opening the connection, getting the datareader directly etc., but still the same error. And yes, the connectionstring is correct. The provider I am using is OleDB.OledBFactory.Instance. Any help/guidance on this is really appreciated. Shreekar

      M Offline
      M Offline
      Michael P Butler
      wrote on last edited by
      #2

      shreekar wrote:

      Dim dr As IDataReader = db.ExecuteReader(strSQL)

      Try Dim dr As IDataReader = db.ExecuteReader(objCommand)

      Michael CP Blog [^] Development Blog [^]

      S 1 Reply Last reply
      0
      • M Michael P Butler

        shreekar wrote:

        Dim dr As IDataReader = db.ExecuteReader(strSQL)

        Try Dim dr As IDataReader = db.ExecuteReader(objCommand)

        Michael CP Blog [^] Development Blog [^]

        S Offline
        S Offline
        shreekar
        wrote on last edited by
        #3

        Thanks a lot!!! I guess I was looking at the code too hard...:doh: But there is something nagging me at the back of my mind.:confused: I think I will test more and respond. Thanks again. Shreekar

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups