Re: CommonDialog beginner's question




"Floria_Tosca" <toscalives@xxxxxxxxxxx> wrote in message
news:1173208244.471342.174740@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Okay, if I were to use a FileListBox instead of a common dialog, which
would list the databases, how would I get it to open the one I click
on, and list the data from the tables in the ListBox? I tried it and
got the same error. I don't even know what References are (I'm a
scientist posing as a programmer), so could someone direct me to any
useful web resources on vb 6?



Well, this newsgroup is considered by some to be a useful web resource on VB6 :)

References are something you set by clicking the Project menu, then
References... You select a file from the list, after which the types defined in
the file are available to your program. In your case, you need a Microsoft Data
Access Objects reference, so you can use DAO objects.

In your original post, you started out with

Set MyDB = OpenDatabase(dbPath)
CommonDialog1.ShowOpen
Set MyDB = CommonDialog1.FileName

The first line opens a database before you run the dialog. The third line
doesn't make sense - its sets your db to a file name.
I think you mean something more like
CommonDialog1.ShowOpen
Set MyDB = OpenDatabase(CommonDialog1.FileName)
which would ask for a filename, then open the chosen file as a database.

Here are some other web resources:

Google. You can search for Visual Basic 6, or click more>>, Groups, and search
archives of all the newsgroups. Very useful for specific problems.

MVPs.org, a list of sites by MVPs, including Randy Birch's VBNet site:
http://www.mvps.org/
http://vbnet.mvps.org/



.



Relevant Pages

  • Re: Run Time Error
    ... Open a code window. ... Solving Problems with Library References ... Compact the database to get rid of this junk: ... form opens and I can select parameters from every spot except the From ...
    (microsoft.public.access.reports)
  • Re: Main Menu Form Will Not Open
    ... What is the name of the form that should open when the database opens? ... Now that I have converted the database what should the new references be? ... When I opened the code and check the references the Microsoft DAO ...
    (microsoft.public.access.forms)
  • Re: Main Menu Form Will Not Open
    ... What is the name of the form that should open when the database opens? ... Microsoft can not find the macro "mnuMain" the macro groups don't exist ... Check for the correct references. ...
    (microsoft.public.access.forms)
  • Re: Database fault
    ... the references in the wrong order... ... Dim MyDb as ADO.Database ... I am working on this database as the ... Set MyDB = CurrentDb ...
    (microsoft.public.access.formscoding)
  • Re: Main Menu Form Will Not Open
    ... What is the name of the form that should open when the database opens? ... Now that I have converted the database what should the new references be? ... Microsoft can not find the macro "mnuMain" the macro groups don't exist or ...
    (microsoft.public.access.forms)

Loading