Results 1 to 3 of 3

Thread: vb.net 2005 problems and problems

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2006
    Posts
    20

    vb.net 2005 problems and problems

    i used Dim dbFileName As String = Application.StartupPath & "\main.mdb" but everytime i run vb.net copies ms access main.mdb file in the debug folder of my project. Infact i just want to read from the main.mdb file which resides in my project and it's already added. i changed the properties of the database in vb not to copy an instace to the output folder but then my application doesn't run it says it couldn't file the database file. Somehow it always try to read from the debug folder. Please ..........Please help me out i am stuck completely
    thankssssssssssssssssssssss

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    Re: vb.net 2005 problems and problems

    You're getting the startup path and looking for "main.mdb" in it. Why are you confused that it keeps looking in the Debug folder? If it's being run from the Debug folder (which it does when you press play), it's only natural the startup path would be in the Debug folder and thus, it'll look for "main.mdb" in the debug folder.

    If you want to leave it in a directory before the one where it's being run, you'll have to parse the Application.StartupPath and modify it, or use an absolute path (meaning the fully qualified path (C:\Documents and Settings\User\My Documents\etc))
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

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

    Re: vb.net 2005 problems and problems

    DO NOT create duplicate threads!
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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