can you tell me how?
im new at database making
I suggest using parameters since they are the easiest explain.
When a parameter is passed in, it gets set to the global "Command" object which is nothing more than a string.
For example, lets say my application is called MyApp.exe and I need to send in the location of my database. This will be the call to open my program with a commandline parameter:
C:\Program Files\VBWheaties\Myapp.exe "C:\Program Files\MyDatabase\MyData.mdb"
As you can see MyApp.exe is being called with the commandline parameter of a database path (C:\Program Files\MyDatabase\MyData.mdb)
In your code, to get access to this commandline parameter:
-
Public Sub OnFormLoad() 'on form load or whatever sub you want to make
-
Dim DatabasePath As String
-
DataBasePath = Command() 'Command() will give us the parameter
-
'Then continue to load your app as normal.
-
End Sub
-
As you can see, Command will have the database path because I passed it in when I launched the exe at the command line (Start>Run)
More traditionally, you can use shortcuts to pass in commandline parameters.
You want to make a shortcut for your executable. Let me know if you dont know how to do this.
In the shortcut, and on the Shortcut tab, you'll see the location of your exe.
After the quote surrounding the path to your exe (if there is one), put a space, then type in your parameter. Put it in quotes. Save the shortcut.
When you double-click this shortcut, it will pass the value typed in. This is the commandline parameter that your application will use. Its pretty powerful stuff: you can pass in any string value you choose and your app can use that to do something custom, like change the path to your database file.