how to set path?
-
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.
-
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.
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
-
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
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...
-
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...
Are you absolutely sure the database file is being written to the same directory as your .EXE? RageInTheMachine9532