I have made a program that reads and writes to db's which has the extension ".mdb". Now i tried the code if i changed the extension to ".kom" instead and it still works fine and dandy but they can't open it in msacess unless they say open with ms access. Now i was wondering if there is a way in code to say that ".kom" files have "c:\myico.ico" as an icon and open with "c:\myprog.exe"? I know how to do it manually but have no idea how to do it in code.

Also this is how you can open a file with its default extension.
Code:
Call ShellExecute(Me.hwnd, vbNullString, "C:\happy.txt", vbNullString, vbNullString, 0&)
and here is another way
Code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Const SW_HIDE = 0
Private Const SW_MAXIMIZE = 3
Private Const SW_MINIMIZE = 6
Private Const SW_NORMAL = 1


Call ShellExecute(Me.hwnd, vbNullString, "C:\happy.txt", vbNullString, vbNullString, SW_NORMAL)
Now is there a way to specifiy what program you want the file to be opened it? Like for example instead of having
"C:\mytext.txt" open in notepad maybe i want it to open up in wordpad or ms word. Is there a way to do this?

Thanks!!