Data List & ADO Data Control


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Data List & ADO Data Control

  1. #1
    Chris cherryholmes Guest

    Data List & ADO Data Control


    In a small database project I've used Data bound List box bound to a ADO Data
    Control. I've bound the ListField property to the 'ItemName' feild in the
    database and then use it as a pick list to bookmark the selected possition
    in the database. This all works great. The problem arises when I move the
    app to a different location. It can't find the data base (path name wrong
    error)even though I have written the connection string in the Form_load event
    in the code module to point to the 'App.Path'. In debug mode the error arises
    when ever it hits this line of code '.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data
    Source=" & App.Path & "\Door Builder.mdb" '. The interesting thing is that
    if I remove the Data List control and run the project again it makes the
    connection fine finding the correct path. Is there something I'm missing
    or is this a bug with VB. I've just installed SP 4 so I have the latest updates.
    Help!!

    Chris


  2. #2
    Paul Clapham Guest

    Re: Data List & ADO Data Control

    Don't know if this applies in your case, but if your app's path is the root
    directory of a drive, then App.Path returns e.g. "H:\" and then your Source
    becomes "H:\\Door Builder.mdb", which is a Bad Thing.

    <Chris cherryholmes> wrote in message news:39664cfb$1@news.devx.com...
    >
    > In a small database project I've used Data bound List box bound to a ADO

    Data
    > Control. I've bound the ListField property to the 'ItemName' feild in the
    > database and then use it as a pick list to bookmark the selected

    possition
    > in the database. This all works great. The problem arises when I move the
    > app to a different location. It can't find the data base (path name wrong
    > error)even though I have written the connection string in the Form_load

    event
    > in the code module to point to the 'App.Path'. In debug mode the error

    arises
    > when ever it hits this line of code '.ConnectionString =

    "Provider=Microsoft.Jet.OLEDB.4.0;Data
    > Source=" & App.Path & "\Door Builder.mdb" '. The interesting thing is that
    > if I remove the Data List control and run the project again it makes the
    > connection fine finding the correct path. Is there something I'm missing
    > or is this a bug with VB. I've just installed SP 4 so I have the latest

    updates.
    > Help!!
    >
    > Chris
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center