Nov 21, 2009
Pages: 1, 2

VB6-MS Access Question - help please

free web hosting

Read Latest Entries..: (Post #14) by iGuest on Nov 3 2009, 09:11 PM.
opening a database in vba VB6-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    .Ru...
read more.
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Open Discussion & 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.

Comment/Reply (w/o sign-up)

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

 

 

 


Comment/Reply (w/o sign-up)

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.

Comment/Reply (w/o sign-up)

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 .


Comment/Reply (w/o sign-up)

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.



Comment/Reply (w/o sign-up)

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

Comment/Reply (w/o sign-up)

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.

Comment/Reply (w/o sign-up)

FeedBacker
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

Comment/Reply (w/o sign-up)

iGuest-Jawa James
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

Comment/Reply (w/o sign-up)

iGuest-ibilola
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

Comment/Reply (w/o sign-up)

Latest Entries

iGuest
opening a database in vba
VB6-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

 


Comment/Reply (w/o sign-up)

HannahI
Cool! biggrin.gif

Comment/Reply (w/o sign-up)

iGuest
vb6 - access
VB6-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


Comment/Reply (w/o sign-up)

iGuest
Replying to iGuest-Jawa James
VB6-MS Access Question

Replying to iGuest-Jawa James I think the memory of your computer is so small that's why it takes Time 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

 


Comment/Reply (w/o sign-up)


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*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Pages: 1, 2
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) Anybody knows how to go about creating the class? What
    the... I mi....
  3. VB.NET & MS Access Issue
    (7)
    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

See Also,

*SIMILAR VIDEOS*
Searching Video's for ms, access, query
advertisement



VB6-MS Access Question - help please

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com