Jump to content
xisto Community
Sign in to follow this  
sandeep1405241520

VB6-MS Access Question help please

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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/

2. http://forums.xisto.com/no_longer_exists/

 

Otherwise simple Google for "vb6 file type association" and you'll get plenty of hits.. Here's the link to the Search Results: https://www.google.de/webhp?gws_rd=cr,ssl&ei=2kUDVZipN8m-ygOP14KgBQ

 

 

All the best,

m^e

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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:
Dim FileNum As Integer 'Put this into the declararions section'FileNum= FreeFileOpen '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
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:
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) :P .

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Please, how do I link vb to access?After filling a form in vb, how di I link the submit button of vb to access table. Also, how will I access the store values in access.Please, help me with the procedure and the code.Thank you-reply by ibilola

Share this post


Link to post
Share on other sites
visual basic 6.0VB6-MS Access Question

how do you search a particular table which is given by user as a string in visual basic 6.0 and he wants to search whether that particular string which is the table name in database is present or not what is the query that I can write plz help

its urgent thnx in advance 

-question by sabiha

Share this post


Link to post
Share on other sites
Replying to iGuest-Jawa JamesVB6-MS Access Question

Replying to iGuest-Jawa JamesI think the memory of your computer is so small that's why it takesTime to access the data of your data base.. I suggest to uninstall the other programs in your computers so that it will run accurately..

-reply by janmark

 

Share this post


Link to post
Share on other sites
vb6 - accessVB6-MS Access Question

If you want to access the data of MS access using visual basic 6,, you have to follow the following steps:

step 1:

go to control panel click "performances and maintenance", then click "administrative tools", and double click "Data Sources (ODBC)". When you see a dialog, click "system dsn" and click "add" then double click "microsoft access driver (*.Mdb)". click "select", then find the  MS access database where you save. And click ok. in "data source name type" the filename of your Ms access data base ( for example db1) . Then click OK. Press enter.

step 2:

start an vb6  then select "standar EXE".  click "project", click "components". In control check the "microsoft ado data control 6.0 (OLEDB)" then click ok. Then click the data control in the tools and add it in your form1 "adodc1" right? 'you can see it in the last tools beside the OLE name adodc1'. Put it in the form1.

 

after that. Righ click adodc1, click "adodc property" select the  ADODC data source name and fill the file name of your MS access data base (for example "db1"). After that click "record source" then fill the "command text (SQL)" input this command "select * from table1",,, if the table name of your data base is table1. Then click ok.

step 3:

 make a text name text1 then click it. And fill the properties bellow

datasource = click the arrow bellow and select adodc1

datafield =  click the arrow bellow and select field ( for example "name")

 

step 4:

try to run your program.

 

this is very sensitive.. That's why I advice to use a filename of your database is "db1" and the table is "table1" so that you can follow all the instructions I've given.. That's it.

 if the data of your MS data base is in the text1.Text, it means you got it.. But if not.. Try to analize of your mistake.. This is very sensitive... Try to be positive and patient.. I hope this comment will lead you success..

 -reply by janmark

Share this post


Link to post
Share on other sites
opening a database in vbaVB6-MS Access Question

We have just converted over to office 2007.  In my databases I have one database calling another, before the conversion it opened fine, now it just opens and then closes.   the code I used is

dim strdb as string

strdb = "flie name and path"

set appAccess = CreateObject("Access.Application")

With appAccess

.OpenCurrentDatabase strdb

. Visible = True

.RunCommand acCmdAppMaximize

end with

can anybody help me with this

 

 

-question by rick

 

Share this post


Link to post
Share on other sites
calling ms acccess switchboard by vb6 but the report of the switchboard is not openingVB6-MS Access Question

I make a ms access database with switchboard. I used vb code to call the switchboard of msaccess. The forms of the switchboard are working fine when I click but the reports are not opening. When I click the report from the switchboard, it looks like opening but it doesn't pop up. From ms access report properties, I make pop up and madal to yes but still not working.Is there any one who can help me with this? your help will be much appreciated.

-reply by ahid zameel

Share this post


Link to post
Share on other sites
Retrieve tree View database structure from MS-Access using VB6VB6-MS Access Question

Hi,

I am facing problem in Vb6 that how can I retrieve a tree structure data from MS Access.

My table def. Is as follow:

    CurrentID         Description       PrvID

  1                         Node1 0

      2                       Node2 1

      3                         Node3               2

      4                       Node4               2

      5                   Node5   2

      6                         Node6             3

    7                       Node7           3

      8                       Node8           1

Now the question is this that:

1)   How can we retrieve the entire structure in tree view form in a list box

2)   suppose we want to retrieve then tree structure of a particular node Like Node2.How?

3) I have some idea that this problem can be solve through recursion method.

Solve this problem and mail me.

Thanks in advance.

   

-question by VikramKeywords:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.