Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How  can VB load an Access DB in Access?

Posted on 2001-06-05
11
Medium Priority
?
168 Views
Last Modified: 2010-05-02
As a near novice, can someone tell me how to load an Access DB into Access (onClick, say) from an .exe?
I suspect it's very easy.....is it?
0
Comment
Question by:cyfiddler
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 5

Expert Comment

by:AndrewDev
ID: 6155654
Try this code to add a new table into an Access database

http://www.freevbcode.com/ShowCode.Asp?ID=439
0
 
LVL 5

Expert Comment

by:AndrewDev
ID: 6155669
Rereading a question what do you mean by load an Access DB into Access. If it is already an Access DB isn't it in Access already?

What exactly ar eyou trying to do?

Regards
Andrew
0
 

Author Comment

by:cyfiddler
ID: 6155694
Andrew, Sorry I should have explained further.
The ultimate aim is to autorun a DB direct from a CD,using autorun.inf.
Ideally, the Access DB would run directly, but (hopefully)the VBproject.exe could act as an intermediary (one of the limitations of autorun.inf)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 3

Expert Comment

by:jrspano
ID: 6155857
are you going to put the vb program on the cd also?  you will have to install all the dll and other things the program needs on the client cpu to get it to run.
0
 

Expert Comment

by:RustyG
ID: 6156695
You can use the ShellExecute API to lauch any file with its associated application:

-- code --

Public 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

Const SW_SHOWNORMAL = 1

Call ShellExecute(me.hwnd,"open", "mydatabase.mdb",0,"",SW_SHOWNORMAL)

-- end code --

Even works with URLs' too:

Call ShellExecute(me.hwnd,"open", "http://www.experts-exchange.com",0,"",SW_SHOWNORMAL)
0
 
LVL 5

Accepted Solution

by:
AndrewDev earned 200 total points
ID: 6157733
I know RustyG has locked this question by proposing an answer but I think this would do it for you

Open a File with its Associated Application
http://www.freevbcode.com/ShowCode.Asp?ID=525

This contains two methods one using the registry and the second one is the one that RustyG proposed. Have a look at both and take your pick

Good Luck
Andrew
0
 
LVL 5

Expert Comment

by:AndrewDev
ID: 6157762
RustyG
I know you are new to EE so this is a gentle warning to prevent other experts slagging you off in future.

It is an unwritten rule that we dont propose answers to enable other experts to contribute. There are often many possible solutions to a problem and it is best to let the person who asked the question decide which comment to accept.

Regards
Andrew :)
0
 

Expert Comment

by:RustyG
ID: 6158865
Whoops!
Sorry guys, didn't realise that Posting an 'Answer' would lock it for others.  Sorry to step on any virtual toes - it won't happen again!
0
 

Author Comment

by:cyfiddler
ID: 6160757
as explained by AndrewDev
0
 
LVL 5

Expert Comment

by:AndrewDev
ID: 6161505
RustyG
No problem, I was only prevented from making the same mistake by a coleague. For further clarification and advice follow the tips on comments and answers link below.
Hope you have lots of fun on EE

Regards
Andrew :)
0
 

Author Comment

by:cyfiddler
ID: 6173204
We used Call ShellExecute and it worked fine.

Thanks.......
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question