ADO Connect String


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: ADO Connect String

  1. #1
    Danny Desmet Guest

    ADO Connect String


    When developping a program using a ADO Data Control you have to build a connect
    string (p.e. a connection to an access database) wich remains hard coded.
    When porting the program to an other computer where te database is located
    in an other directory , the program do not work any more.

    I have tried the following :

    Before using the ADO data control I change the connect String with a new
    value :

    p.e. form.datacontrol.ConnectString = "............."

    Even then the datacontrol still tries to connect to the hard coded connect
    string

    How do i have to solve this problem ???


    Thanks,

    Danny Desmet





    Share on Google+

  2. #2
    Dan Appleman Guest

    Re: ADO Connect String

    I haven't used the ADO data control - I tend to use ADO directly. I haven't had a
    problem changing the database
    connection string there.

    Dan


    Danny Desmet wrote:

    > When developping a program using a ADO Data Control you have to build a connect
    > string (p.e. a connection to an access database) wich remains hard coded.
    > When porting the program to an other computer where te database is located
    > in an other directory , the program do not work any more.
    >
    > I have tried the following :
    >
    > Before using the ADO data control I change the connect String with a new
    > value :
    >
    > p.e. form.datacontrol.ConnectString = "............."
    >
    > Even then the datacontrol still tries to connect to the hard coded connect
    > string
    >
    > How do i have to solve this problem ???
    >
    > Thanks,
    >
    > Danny Desmet
    >
    >


    Share on Google+

  3. #3
    Danny Desmet Guest

    Re: ADO Connect String


    When using ADO directly there is indead no problem but in some cases (p.e.
    when you use a control that is bound to the ADO datacontrol - p.e. a True
    DBGRid) there is no choice.

    Danny Desmet



    Dan Appleman <dan@desaware.com> wrote:
    >I haven't used the ADO data control - I tend to use ADO directly. I haven't

    had a
    >problem changing the database
    >connection string there.
    >
    >Dan
    >
    >
    >Danny Desmet wrote:
    >
    >> When developping a program using a ADO Data Control you have to build

    a connect
    >> string (p.e. a connection to an access database) wich remains hard coded.
    >> When porting the program to an other computer where te database is located
    >> in an other directory , the program do not work any more.
    >>
    >> I have tried the following :
    >>
    >> Before using the ADO data control I change the connect String with a new
    >> value :
    >>
    >> p.e. form.datacontrol.ConnectString = "............."
    >>
    >> Even then the datacontrol still tries to connect to the hard coded connect
    >> string
    >>
    >> How do i have to solve this problem ???
    >>
    >> Thanks,
    >>
    >> Danny Desmet
    >>
    >>

    >


    Share on Google+

  4. #4
    Phil Weber Guest

    Re: ADO Connect String

    > When developing a program using an ADO Data Control,
    > you have to build a connect string which remains hard-
    > coded. When porting the program to an other computer
    > where the database is located in another directory, the
    > program does not work anymore.


    Danny: I would suggest clearing the data control's Connect property at
    design time and setting it in your initialization code (Form_Load or Sub
    Main) by reading the database location, etc. from the registry or an .INI
    file.
    ---
    Phil Weber


    Share on Google+

Similar Threads

  1. map network drive
    By Michael C in forum VB Classic
    Replies: 3
    Last Post: 07-30-2002, 02:15 AM
  2. Re: App Object (fixes)
    By Rob Teixeira in forum .NET
    Replies: 129
    Last Post: 06-06-2002, 05:23 AM
  3. App Object
    By Rob Teixeira in forum .NET
    Replies: 15
    Last Post: 05-31-2002, 03:30 PM
  4. ADO connect string to AS400
    By ren in forum VB Classic
    Replies: 0
    Last Post: 02-19-2002, 02:31 PM
  5. Database problems
    By Robert Rieth in forum VB Classic
    Replies: 1
    Last Post: 04-11-2000, 03:21 AM

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