Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2012
    Posts
    8

    Unanswered: VB 2008 setting up database either access or sql

    Im currently making a program for my teams clock in clock out time sheet. the problem is that Im working on it at home because there is no VB in the office. What code should I use to set up this:

    Dim con As New OleDbConnection("Provider=Microsoft.jet.oledb.4.0; data source=E:\VBproject\myDB.mdb")

    so I can make the project at home and bring it to the office. the database will be placed on a network folder in the office which only a few people have access.

    Thank you for your help.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Use either an app.config or web.config file to hold the connection string. Then fetch the connection string when you need it via the ConfigurationManager:

    Storing and Retrieving Connection Strings

    I prefer to use AppSettings myself but for your purposes I imagine straight ConnectionStrings per the above link will be just fine.

    If you are not familiar with the app.config/web.config files, it is worth your while to walk through some tutorials. They make life a little easier.

    Note this method will leave your connection strings sitting around in a plain text file. If that bothers you then you'll need to get a little more creative, such as storing the encrypted strings in an appSetting and decrypting them when needed. I won't go there right now, just be aware there are options once you get the basic idea.
    Last edited by Teddy; 08-17-12 at 03:12.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Aug 2012
    Posts
    8
    Thanks so much.. I will try this out.

Posting Permissions

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