Click to See Complete Forum and Search --> : Search files for inputting into Database
mtrack81
July 31st, 2001, 08:21 AM
I am using Access 97, and as of right now i prompt the user of the database to manually enter the filename that they want to input, which will be manipulated by the code. What i want to do is to prompt the user so they will be able to browse the files on their hard drive and select the one they want to input. All help is appreciated. thanks
Ghost308
July 31st, 2001, 08:25 AM
You're going to want to use the Common Dialog control which can be added to your project by clicking the Project -> Components menu in VB. Put that control somewhere on your form (doesn't really matter where because its invisible at run-time) and use
Dim MyFile as string
CommonDialog1.ShowOpen
MyFile = CommonDialog1.FileName
'open the file for processing
Hope that helps! Good luck!
Cakkie
July 31st, 2001, 08:30 AM
In Access that would be menu Extra>AxtiveX Controls
If 'Microsoft Common Dialog Controls' isn't in the list, select the register button and browse to the file (probably c:\windows\system\comdlg32.ocx).
If it is in the list, close the window.
In you workset (in the design view of an Access form), there's a button 'More ActiveX Controls', click it, and a list will appear. In the list, scroll down to 'Microsoft Common Dialog Control' and drag it on the form.
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
mtrack81
July 31st, 2001, 08:41 AM
You answered my question even before i asked it... but the problem is that in (C:\Windows\system\comdlg16.ocx) Access won't register it. The error i get is that it could not be added. Install the control using a separate setup utility. WHere do I go from here?
Cakkie
July 31st, 2001, 09:02 AM
comdlg16? That should be comdlg32, 16 is the 16bit version, the one form win 3.x
First check if there isn't added already. If 'Microsoft Common Dialog Control' is in the list. If it is, you don't need to do the registerring stuff yourself.
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
mtrack81
July 31st, 2001, 09:08 AM
I know for sure that it isn't registered, b/c it tells me to register the common dialog box when i try to use it. I searched under C:\Windows\system, and the closest i found was CMDL32, which is an application. I don't think this is the one i need, i know this is kinda tough trying to explain, but i'm stumped at this moment. Is there anyplace that i can get comdlg32.ocx? any suggestions?
Cakkie
July 31st, 2001, 09:15 AM
Ok, I don't get it. Comdlg32 comes with almost every application, expecially those form M$, like Office and stuff. If you have Win98 or above, it is located in the c:\windows\system32 directory. Try searching for it (using Start menu> find> files or folders). Also make sure that your explorer displays hidden and system files (using the view>options menu in explorer).
If you manage to get the file, try it again using Access. if it fails, you might need to register it yourself using regsvr32.
Good Luck
Tom Cannaerts
slisse@planetinternet.be
Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
mtrack81
July 31st, 2001, 09:27 AM
well i found comdlg32.dll, and i tried opening it with regsvr32, but failed to work...i'll try to find the file (comdlg32.ocx) online and download it to see if it'll solve my problems..thanks alot for all the input. any other suggestions are welcome.
Mitesh
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.