Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> VB6-MS Access Question, help please
sandeep
post Apr 17 2006, 01:55 PM
Post #1


Member [ Level 1 ]
Group Icon

Group: Members
Posts: 31
Joined: 16-April 06
Member No.: 12,789



hi guys,

I am developing an application in Visual Basic 6.0 and using MS Access as my backend. What i want is that my database should not open when someone doublec clicks on the .mdb file. But my application should be able to access it.

What can be a possible solution to this problem?

Please help.

Thanx in advance.
Go to the top of the page
 
+Quote Post
miCRoSCoPiC^eaRt...
post Apr 17 2006, 03:42 PM
Post #2


PsYcheDeLiC dR3aMeR
Group Icon

Group: Admin
Posts: 2,242
Joined: 29-January 05
From: Nakorn Chaisri, Thailand
Member No.: 2,411



By default when you install MS-Office, the File Associations are set so that when you double-click on a .mdb file, MS-Access is launched and the file is opened up in it.

If you want your own program to open the .mdb instead, you've to reset the file association to and make the .mdb extension point to your own program. This can be done manually from Windows Explorer > Tools > Folder Options > File Types OR, you can write some extra code inside your program to programmatically reset the association.

Here are a couple of articles that might help you get started with associating file types with your own code.
1. http://forums.devarticles.com/asp-developm...n-vb6t-189.html
2. http://www.codeguru.com/vb/gen/vb_system/d...icle.php/c4837/

Otherwise simple Google for "vb6 file type association" and you'll get plenty of hits.. Here's the link to the Search Results: http://www.google.com/search?sourceid=navc...ype+association


All the best,
m^e
Go to the top of the page
 
+Quote Post
marsden
post Jun 1 2006, 09:32 AM
Post #3


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 5
Joined: 27-May 06
Member No.: 13,682



QUOTE(miCRoSCoPiC^eaRthLinG @ Apr 17 2006, 12:42 PM) *

By default when you install MS-Office, the File Associations are set so that when you double-click on a .mdb file, MS-Access is launched and the file is opened up in it.

If you want your own program to open the .mdb instead, you've to reset the file association to and make the .mdb extension point to your own program. This can be done manually from Windows Explorer > Tools > Folder Options > File Types OR, you can write some extra code inside your program to programmatically reset the association.


I agree with this to an extent. The problem with doing the above is that all .mdb files will call your program if you set it up this way. I would suggest moving your .mdb to a hidden folder so that no one will be able to see it therein stoping anyone from opening it.
Go to the top of the page
 
+Quote Post
Lee-Programmer
post Oct 13 2006, 02:09 PM
Post #4


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 11
Joined: 13-October 06
Member No.: 16,536



QUOTE(marsden @ Jun 1 2006, 05:32 PM) *

I agree with this to an extent. The problem with doing the above is that all .mdb files will call your program if you set it up this way. I would suggest moving your .mdb to a hidden folder so that no one will be able to see it therein stoping anyone from opening it.


Not exactly. Keeping a file hidden will make things more complicated as the user might want to move the program and, without notice, leaves the .mdb file behind. Besides, you need to manually make the file hidden or else you are breaching software trust laws.

If you don't mind the .mdb file to be edited, keep it visible and include a readme file to tell the user to move along with the program.

If not, do the same, but include these step:
1. Design or get the source code of an encrytion program and add that to your program.
2. Encrypt the .mdb file
3. Program the code so that you create a cache of the decrypted file. READ ON FIRST!!!
4. Add this code at the program's startup right after finishing the chache:
CODE
Dim FileNum As Integer 'Put this into the declararions section'
FileNum= FreeFile
Open 'Inset code here' For Input as #FileNum

5. Those who understand file acess will truly laugh at this. You keep the file used by the program and it can hardly be acessed except by some proffesional programmer.
6. Just before you close the program, add
CODE
Close #FileNum
or else you will need to restart the computer before being able to reuse the application again.

Alternatively:
1. Use Microsoft Acess to lock the .mdb file with a password. In Tools > Options menu. It's not hard to find from there.
2. In the VB development, right click on the tool bar and select Components... and search for Microsoft ADO Data Control. Use it in replacement of the default Data Control. It's a but different but the basics is still the same. Experiment with it for a while. Adapt the program to the control.
3. Just before acessing the file add:
CODE
Adodc1.password = 'password
to the code. Note: replace the name of the component as necessary.
This method is simpler but causes some campatability issues. I will only reccomend this to people with experience in the field of compatibility (or you could take the fun out by including the .dll file of the ADO component into the same directory as the program) wink.gif .

Go to the top of the page
 
+Quote Post
Christo
post May 29 2007, 08:20 AM
Post #5


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 2
Joined: 29-May 07
Member No.: 22,239



QUOTE(sandeep @ Apr 17 2006, 03:55 PM) *
hi guys,

I am developing an application in Visual Basic 6.0 and using MS Access as my backend. What i want is that my database should not open when someone doublec clicks on the .mdb file. But my application should be able to access it.

What can be a possible solution to this problem?

Please help.

Thanx in advance.


Go to the top of the page
 
+Quote Post
Christo
post May 29 2007, 08:23 AM
Post #6


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 2
Joined: 29-May 07
Member No.: 22,239



Hi,

An easy way is to rename your access xxxxx.dbn to something like xxxxx.dbz. In your vb app change your filename accordingly.
Regards
Christo
Go to the top of the page
 
+Quote Post
Feussy
post Jun 25 2007, 01:05 AM
Post #7


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 10
Joined: 25-June 07
Member No.: 22,900



i'd date to be repetitive, but the previous user is 100 percent correct and I just wanted to elaborate on his posting. The file extension on a file has no impact on the data within it. As long as the file's data structure doesn't change, you'll be able to read and right to the file just like a normal database and your end user won't be able to harm it. And, if you find the need to edit the database live, you can always change back the file extension and open it with Access.
Go to the top of the page
 
+Quote Post
iGuest
post May 9 2008, 11:19 AM
Post #8


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 0
Joined: 1-November 07
Member No.: 25,869



want to use a sinlge user MS Access , VB6 application on network but the speed should be excellent
VB6-MS Access Question

I want to use my VB6 and MS Access Project on the network for multi use on 4-5 machnies currently I am using the map drive and shring feature through visual basi but the speed is remarkably slow on the client nodes. What should I do to enhance the speed of data transaction and to maintain the locking so that more than one user can work on the application simultaneously on the same module/ same input window...

-reply by Shiv
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. VB.NET / MS Access Question(6)
  2. VB.NET & MS Access Issue(3)


 



- Lo-Fi Version Time is now: 22nd August 2008 - 01:35 AM