First, you should use an OpenDialog object. It can be customized a
little.
Second, it would be helpful if you could more precisely say how your
code "does not work". Does it not compile? If not, the compiler
will provide an error message. If it compiles, then presumably
something bad happens when the program is running.
Here is a bit of sample code that may work.
dim dlg as new OpenDialog
dlg.Filter = ".rbd"
If dlg.ShowModal <> nil then
CustomerDB.DatabaseFile = dlg.Result
//proceed with db open
Else
//user cancelled
End if
Charles Yeomans
On May 27, 2006, at 1:25 PM, TJ Hanson wrote:
I have a database (CustomerDB.rbd) that was created by Program 1.
From Program 2, I want to access this database. So I need to have
the user locate it, then connect to it.
My question is, how do I do this?
----------------------------------------------------------------------
------------------------------------------
CustomerDB.DatabaseFile = GetOpenFolderItem("rbd") // user
locates the Customer DB file.
IF (CustomerDB.Connect = FALSE)
THEN // connect to customer DB.
DisplayCustomerDBError
Quit
END IF
----------------------------------------------------------------------
------------------------------------------
The above code does not work since GetOpenFolderItem is probably
the wrong method, or I am using it incorrectly, since it returns a
folderitem.
What's the solution? Thanks for the help,
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>