CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Database Access

  1. #1
    Join Date
    Nov 2000
    Location
    IL, U.S.A.
    Posts
    218

    Database Access

    I want to burn my program on a Cd. It access a data base that has user names and passwords. The database is in the same folder as the program. I set the correct jet and the connection is just the database file name. I put this code in the form main of the logon form.
    Dim dbName As String
    dbName = App.Path & "\NameandPassords.mdb"
    When I run the program it gives me a message box showing the path to the database and that it can't access it. The path is like Crogram files/MicrosoftVisualStudio/VB98....etc but I just have the database name in the connection box. I can't figure out what is wrong. Also when I burn the program it gives me the same error and how can I make the program so I can still enter data into the database after I burn it?



  2. #2
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: Database Access

    You must have used

    dbName = App.Path & "\NameandPassords.mdb"
    Data1.DatabaseName = dbName

    So, keep the DatabaseName field of the data control empty.
    Now, it should work

    And while burning the CD, don't do it in the root, instead, keep it in a folder, I mean, instead wo writing the program to f:\, put it in a folder, say F:\MyProgram. I got the path not found error when I burned my program in the root.

    One problem with burning the names and passwords database to the CD is that you will not be able to add to these.


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

Featured