Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Common Dialog & Ms Access 2

Status
Not open for further replies.

3576

Programmer
Jan 28, 2005
32
US
I need to open MS database using commong dialog. What is the filter name for MS database?

Thanks,

TW
 
What do you mean the filter name?

to use the filter is usually the display name and the *.extension seperated by a pipe character | (Shift + \)

such as:
Text Files|*.txt
or...
Text Files|*.txt|All Files|*.*

For Example:
Code:
Private Sub Command1_Click()
  CommonDialog1.Filter = "Text Files|*.txt|All Files|*.*"
  CommonDialog1.ShowOpen
End Sub


Visit My Site
PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
Thank you for this reply. What I need is the name of the filter for the MS Access *.mdb
CommonDialog1.Filter = "All Files|*.*| ? *.mdb"

Thanks,

TW
 
In the file open dialog in Access itself these are called "Microsoft Access Databases" so you might use the filter value:

"Microsoft Access Databases|*.mdb"

I'm not how helpful "all files" would be as an option in this case.
 
Hmm, more standard I suppose would be a filter value like:

"Microsoft Access Databases (*.mdb)|*.mdb"

Sorry I sent the previous response before reading what I had typed more closely.
 
What you put before the PIPE character just appears as text in the 'Files of type' box - it doesn't affect the actual filter. You can use:

.Filter = "My Files|*.mdb"

and the filter will just get the .mdb files, but will show 'My Files' in the file type box underneath

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'

for steam enthusiasts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top