Changing connection data depending on which button is pressed.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • joosa
    New Member
    • Oct 2007
    • 1

    Changing connection data depending on which button is pressed.

    hai guyes,
    I am trouble in visual basic. Please help me.

    My trouble is, I made two databases in two directories. eg. D:\student.mdb and E:\Student.mdb. Now I have a listbox in visual form and select 1, 2 and If I click 1 I want to connect my databases in D:\Student.mdb and If I click 2, I Want to connect E:\Student.mdb. How can this possible. And I have a command button on vb form Proceed. When I click proceed I want to connect my adodc to the respective database.

    Can anyone help me.

    Joosa K.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Use different connection strings on user inputs .Use listindex of the selected item to change connection string at runtime.

    Use separate connection objects for both the connections.

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      Heya, Joosa. Welcome to TSDN!

      Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).

      I'm going to go ahead and move this thread to the VB forum, where our resident Experts will be better able to help you out.

      Comment

      Working...