If you want to dynamically select your path and/or file, then use the FileOpen dialog/control.Īs for code examples, I haven't used real VB6 in almost 5 years, so I do not have any true examples or anyway to make one. Then on the other system, point it's App.Path to your share. The user should be able to browse for the MDB file on any drive including file shares on remote systems. The MDB selection subdialog the user opens is pretty much a standard CommonDialog.ShowOpen dialog. I hope this comes close to what you were requesting, it was a little vague. I suppose just passing CurDir$() might have been clearer in this case. It looks for/saves the UDL sample.udl in CD (usually App.Path), and the MDB selection dialog opens in App.Path. This example uses a relative path (current directory, usually the same as App.Path) for sample.udl and sets the MDBSearchStartPath (where the Select Access database dialog opens) to App.Path (because this dialog defaults to where the last CommonDialog had been opened). This function opens the database, calls DoDbOperations() (not shown) to actually work with the open database, and then closes the database Connection. The DbActions() function is simply an example of calling DbOpenPromptSave() to open the database. If DbOpenPromptSave(connDB, "sample.udl", App.Path) ThenĭoDbOperations connDB 'Whatever you need to do until closing. SaveToFile UDLPath, adSaveCreateOverWrite WriteText " Everything after this line is an OLE DB initstring", _ 'respects the Current Directory of the process.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |