Results 1 to 5 of 5

Thread: Visual Basic and Databases

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2018
    Posts
    4

    Visual Basic and Databases

    Hello sorry for this question but I am starting back into SQL databases with the book visual basic and databases professional edition for the 2012 version of visual studio. I know this is a question I should already understand but one instance in the book wants me to create a directory for the said files to be used from. I am not sure if I should create a new directory or simply a file for them. I always make this mistake when faced with this issue I know how to do both but did not know which one was to be used.

  2. #2
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    6,582

    Re: Visual Basic and Databases

    Quote Originally Posted by Trojans72 View Post
    ... I am not sure if I should create a new directory or simply a file for them. ...
    I don't know what creating "a file" for the files means.
    I assume you may have multiple examples throughout the book, and each example should be created in a separate folder for organization.

    If these files are going to be shared between multiple examples, or exercises, then again, I assume they are saying to create a folder, and place the file in that folder.
    Then, later in the various examples or exercises when you need to access those files, they are available to any project, independent of the project you're working on.

    Bottom line, it sounds like they want you to create a folder, and place the files in that folder, so they are easy to use as a related group of files in one location.
    "Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Visual Basic and Databases

    Quote Originally Posted by Trojans72 View Post
    the book wants me to create a directory
    Quote Originally Posted by Trojans72 View Post
    I am not sure if I should create a new directory
    You should do what the book wants you to do.

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 2018
    Posts
    4

    Re: Visual Basic and Databases

    Thanks sorry I should have put what the book said to do "Make a copy of the database and place it in a working directory (you decide on a name we will use VBDB\WORKING)." I think I will go with the directory since that seems like the best idea.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Visual Basic and Databases

    Is it suggesting that that folder be created under your project or elsewhere? If it's a folder for multiple databases for multiple projects then I'd suggest creating the same folder structure they suggest under your Documents folder. If it's under your Documents then it can't get lost or interfere with something else and if you use the same names as the book then there can be no confusion later. You can also easily get the path in code, e.g. if you put a file named MyDatabase.mdb in that folder then the path would be:
    vb.net Code:
    1. Dim dataFilePath = IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.MyDocuments, "VBDB\WORKING\MyDatabase.mdb")

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