Results 1 to 4 of 4

Thread: Selecting a new database at runtime

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 1999
    Posts
    13

    Post

    S.O.S.
    Please help me. I am creating a program in VB 5.0 and am letting the user pick a access database with the commondialog control. I am using the data control to access my database. Can anyone give me some code I can add to let the user pick a database?
    Thanks
    -VbMichael

  2. #2
    Lively Member
    Join Date
    Jun 1999
    Location
    Raleigh, NC
    Posts
    70

    Post

    You can use the common dialog control to actually 'pick' the .mdb file. Once you have the path name to the file, assign the database to your db variable (or to your data control) and you should be in business.

    Bash

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 1999
    Posts
    13

    Post

    I've tried entering the path directly into the data control. I may have forgoten to type this before but my msflexgrid that I am useing to show the user the contence is still blank after I try to directly enter the path into the data control. I've also tried putting an SQL statment in the recordsource proporty to serch for all fields and still nothing shows up.

  4. #4
    New Member
    Join Date
    Feb 1999
    Location
    Palmdale, CA US
    Posts
    14

    Post

    The way I have done this is to connect the data control via a connection string. Build the connection string (with the file chosen from the common dialog) and then write it to the data control. Do a .refresh and all should be hunky dory.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width