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
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))
Re: vb.net 2005 problems and problems
DO NOT create duplicate threads!