Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. how to set path?

how to set path?

Scheduled Pinned Locked Moved Visual Basic
helpcsharpdatabasetutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    emmshazi
    wrote on last edited by
    #1

    Hello all! I have a problem with my application. After completion of my program, when I install it to some other PC & try to run it, it gives me "path not found error" for database file. I have used Ms Access file as my backend. I use Data Adapter Configuration Wizard to make Oledbadapter, Oledbconnection & Dataset. I then realize that the path of my backend file is set according to my computer's path. Someone told me to use Application.Startuppath in connection string. Now I want to know here how to use it, & specially where to use it? As I have mentioned earlier that I use wizard to make connection object, I copy the connection string from oledbconnection's property window & copy it to my form's load event like so (but I didn't delete the Oledbconnection object): Dim cnn as new oledbconnection dim path as string = application.startuppath & "\" & "Database.MDB" cnn.connectionstring="........, Data source=" & path & ",.......... But this thing didn't work here. I still got path error, or sometimes I got this error "Object reference not set to an instance of an object." Isn't there a way by which I can solve this problem? I am using wizard as I am not so familier with VB.NET. Can anyone help me to complete my project.:confused: Thanx in advance.

    D 1 Reply Last reply
    0
    • E emmshazi

      Hello all! I have a problem with my application. After completion of my program, when I install it to some other PC & try to run it, it gives me "path not found error" for database file. I have used Ms Access file as my backend. I use Data Adapter Configuration Wizard to make Oledbadapter, Oledbconnection & Dataset. I then realize that the path of my backend file is set according to my computer's path. Someone told me to use Application.Startuppath in connection string. Now I want to know here how to use it, & specially where to use it? As I have mentioned earlier that I use wizard to make connection object, I copy the connection string from oledbconnection's property window & copy it to my form's load event like so (but I didn't delete the Oledbconnection object): Dim cnn as new oledbconnection dim path as string = application.startuppath & "\" & "Database.MDB" cnn.connectionstring="........, Data source=" & path & ",.......... But this thing didn't work here. I still got path error, or sometimes I got this error "Object reference not set to an instance of an object." Isn't there a way by which I can solve this problem? I am using wizard as I am not so familier with VB.NET. Can anyone help me to complete my project.:confused: Thanx in advance.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      A couple of questions... Is the Database.MDB file shared on a server somewhere or is it local to the client machine? If it is supposed to be local, is the file part of the installation? If it is part of the install, where is the file being written to? RageInTheMachine9532

      E 1 Reply Last reply
      0
      • D Dave Kreskowiak

        A couple of questions... Is the Database.MDB file shared on a server somewhere or is it local to the client machine? If it is supposed to be local, is the file part of the installation? If it is part of the install, where is the file being written to? RageInTheMachine9532

        E Offline
        E Offline
        emmshazi
        wrote on last edited by
        #3

        The file is not shared, its local to client system. I want to deliver this database file to my client, so I added it while I develop my setup & package. So when the setup is run, the file is also installed to application's folder. Now for your last question, sorry I don't understand what you want to say. Its a simple Ms Access file having some tables & relationships between them. That's it. I just want to deliver this file alongwith my application so I add it with the application. Waiting for reply. Thanx...

        D 1 Reply Last reply
        0
        • E emmshazi

          The file is not shared, its local to client system. I want to deliver this database file to my client, so I added it while I develop my setup & package. So when the setup is run, the file is also installed to application's folder. Now for your last question, sorry I don't understand what you want to say. Its a simple Ms Access file having some tables & relationships between them. That's it. I just want to deliver this file alongwith my application so I add it with the application. Waiting for reply. Thanx...

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Are you absolutely sure the database file is being written to the same directory as your .EXE? RageInTheMachine9532

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups