Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Naming and Creating an Access DB using Visual Studio 2005

I have been following a tutorial from Beth Massi (Forms over data Video series) using Visual Basic and have understood it for the most part.

http://msdn.microsoft.com/en-us/vbasic/bb466226.aspx

However when I design a DB as in the tutorial above I reach a point when I have to name the Server and DB. I want to let the User name the DB as the prog runs via an InputBox asking for "Database filename". Can anyone give me some help on how I can achieve this. The tables in DB will relate to a motorsport event and each time it is used the DB needs to be Saved in the name of that particular Race to make re-visits easier.
Many Thanks in anticipation. Jeff

Comments

  • dokken2dokken2 Member Posts: 532
    any time you give the user the opportunity to name an important program component [a database] someone will invariably goof it up.
    that said, what you could do is have a pre-designed db file, say "_initDB.mdb" and then copy the file to a new file with the user provided name.
  • mk1dadmk1dad Member Posts: 2
    : any time you give the user the opportunity to name an important
    : program component [a database] someone will invariably goof it up.
    : that said, what you could do is have a pre-designed db file, say
    : "_initDB.mdb" and then copy the file to a new file with the user
    : provided name.
    :

    Many Thanks for the reply. If I understand you correctly my Events should
    follow the rough route below.

    To OPEN a NEW event DB
    Get the "Name for DB"
    open the existing DB "default name"
    Do everything needed to use the program and get results.
    B4 Closing prog I then need to save the prog under "default name"
    Copy and rename the DB to "Results FolderName for DB"
    open the "default name DB" and clear all entries ready for next use.

    To OPEN an existing race
    I could rename the "Default DB" to "Master DB"
    Rename the DB I wish to open to "Default DB" and open it
    To finish I would repeat the NEW event sequence with modifications.
    Does that rough chain of events seem logical..... Jeff






  • dokken2dokken2 Member Posts: 532
    : : any time you give the user the opportunity to name an important
    : : program component [a database] someone will invariably goof it up.
    : : that said, what you could do is have a pre-designed db file, say
    : : "_initDB.mdb" and then copy the file to a new file with the user
    : : provided name.
    : :
    :
    : Many Thanks for the reply. If I understand you correctly my Events
    : should
    : follow the rough route below.
    :
    : To OPEN a NEW event DB
    : Get the "Name for DB"
    : open the existing DB "default name"
    : Do everything needed to use the program and get results.
    : B4 Closing prog I then need to save the prog under "default name"
    : Copy and rename the DB to "Results FolderName for DB"
    : open the "default name DB" and clear all entries ready for next use.
    :
    : To OPEN an existing race
    : I could rename the "Default DB" to "Master DB"
    : Rename the DB I wish to open to "Default DB" and open it
    : To finish I would repeat the NEW event sequence with modifications.
    : Does that rough chain of events seem logical..... Jeff
    :
    :
    :
    that would probably work fine. the strategy i would use-

    ask user for db name [check if valid name]
    filecopy the INIT.MDB to the user provided name [say Johns.mdb]
    connect to the new database
    user can do what they need, then exit

    next time they start the program, give them a file-open dialog box,
    or better yet have a listbox/combobox showing recently [or all] used files,
    then they can select the file or create a new one.
Sign In or Register to comment.