VB6-MS Access Question - help please

free web hosting
Free Web Hosting > Computers & Tech > Programming > Programming General > BASIC / Visual Basic (.NET)

VB6-MS Access Question - help please

sandeep
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.

Reply

miCRoSCoPiC^eaRthLinG
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

 

 

 


Reply

marsden
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.

Reply

Lee-Programmer
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 .


Reply

Christo
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.



Reply

Christo
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

Reply

Feussy
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.

Reply

iGuest
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

Reply

iGuest
Retrive data from vb6 to Ms Access is really to slow
VB6-MS Access Question

Hi guys,

I got the problem with VB6 which is too slow to retrieve 1086 recordsets from Ms Access. It took about 3 to 5 minutes to show those data on the form.

All you guy have any idea on this? Or any new techncal methods for this?

Many thanks

-reply by Jawa James

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. vb6 access - 13.33 hr back. (1)
  2. ms access question - 32.54 hr back. (1)
  3. vb6 access change extension - 36.84 hr back. (1)
  4. where to to use vb code in ms access for search - 50.85 hr back. (1)
  5. set index mdb in vb 6 - 59.56 hr back. (1)
  6. why is my ms access query so slow .net - 70.99 hr back. (1)
  7. show vb6.0 code to select any row from access database - 80.50 hr back. (1)
  8. .mdb database lock with ado control in vb code - 81.10 hr back. (2)
  9. how to set password to .mdb through vb - 82.81 hr back. (1)
  10. show different vb 6.0 code with ms access 97 database - 83.12 hr back. (1)
  11. vb 6.0 help with ms access 97 - 83.31 hr back. (1)
  12. msaccess is slow - 87.16 hr back. (1)
  13. access to vb6 - 89.06 hr back. (1)
  14. vb6 open file input - 90.47 hr back. (1)
Similar Topics

Keywords : ms, access, query

  1. Auto-number Help In Access Db & Vb .net
    (6)
  2. How To Access Child Node / Collection Items In A Class
    Ways of accessing the child nodes of a Tree Node (6)
    CODE             Dim A As New TreeNode             MsgBox(A.Nodes(15).Text)
                MsgBox(A.Nodes("WTF").Text) Here are two ways of accessing
    the child nodes of a Tree Node, in this case, node A. In the first case, we have accessed the child
    node with Index = 15 of node A. In the second case, we have accessed the child node "WTF" by its
    key. I want to be able to access the members of the Responses class in a similar fashion. Example:-
    CODE         MsgBox(Responses("ASL").Text) Any....
  3. VB.NET & MS Access Issue
    (3)
    Alright, I haven't had much experience with vb.net or ms access as it is, let alone using them
    together, so I need some advice on the best way to do this. I need to create a program that
    basically is a form to fill out with information, and upon filling it out it can be saved. Saving
    consists of making a row in a ms access database and placing each field as a column entry within
    this new row. Then I need to be able to retrieve this information from the DB and fill out the form
    as it was originally if the user chooses to load. This is all fine and wasn't hard to....
  4. VB.NET / MS Access Question
    (6)
    Jeez .. i can see people already starting to take up sticks and stones to beat me up .. well .. i
    know m annoying .. and this always happens when my questions are related to programming
    /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> Newayz ..
    to the point .. I have an MS Access DB .. I need a VB Code to retrieve the value from a field in
    the table. Let me just put it in a better way. I have a table that has a column: Sno. .. under
    sno. i have numbers like 1,2,3,4,5,6,7,8 .... now i created a form where i could view the rec....

    1. Looking for ms, access, query

Searching Video's for ms, access, query
advertisement




VB6-MS Access Question - help please



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE