Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interfacing with other programs 1

Status
Not open for further replies.

hondaman2003

Programmer
Mar 3, 2008
202
US
How can I use VBA in access to get data from other programs? My other programs are not MS Access applications.

For example, I have two other applications, one of them has information that I need. I do not want to have to manually type that information into my access database. I would like to be able to push a button and have access go over to the other application look at each text box and retreive the information to be put into fields on a form.

Can anyone help?
 
Without more information, I can only suggest you learn how to copy and paste individual values.

Some programs may expose their data or have functionality for exporting.

Duane
Hook'D on Access
MS Access MVP
 
I'm very new to this advanced programming with VBA. I am not sure exactly what details you would like.

Lets say for example that I wanted to interface with internet explorer with Access and click a button within Access that would go over to IE and get the contents of the address bar and put it into a field in access. How could I do that?
 
I'm not sure where you have looked for this type of information prior to asking here. There is a thread thread181-1596183 that might provide some help or at least terms that aid in searching.

Duane
Hook'D on Access
MS Access MVP
 
I reviewed that post and it seems no one had a clue what ptw78 wanted to do or everyone thought it should be done a different way than he wanted to.

My goal is sort of the same as his. i want to know how to interface MS Access with other applications. I want to be able to for example retrieve information that is currently displayed in another application window. A very basic example would be in IE, the address bar is basically a text box. How could I get Access to get the contents of the address bar? It's basically this same princliple but with other applications, how to get the data form another application that is currently displaying some sort of data?
 
Not all applications would support the same solutions. If this was Access and Word, you could probably use an API call to get the Word reference and then the Word Object model would provide the syntax for identifying the current document and possibly a bookmark or something that would allow you to grab the value. Microsoft Word Object Model

Not every application works the same so you would need some documentation of the app's internal functionality.

There may be some third party applications that might be able to identify data from different open applications.

Duane
Hook'D on Access
MS Access MVP
 
do you know of any third party applications that would help identify data?
 
Is this something that is very common? Wanting to interface with other programs like this?
 
I do this all the time but generally use ODBC to connect data from one application to another. As I stated earlier, most database applications have some functionality to export and import records.

Duane
Hook'D on Access
MS Access MVP
 
I agree with you but I work at a place where the IT people do not want to help with stream lining things so I thought I would explore the ability to make an access database that will interface with the different applications around here and spit the databack out when needed.
 
The answer is it all depends on the application you want to interface with. Some applications come with sophisticated API's (Application Programming Interfaces) or SDK's (Software Development Kits) that you can connect directly to the application and perform virtually any function that a user could do interactively.

Others only support import and export functions limited to files in a predetermined format.

With applications that use database backends, if you know the connection parameters you could hook directly into the database. The problem with that method is that if you don't know anything about the meaning of the different tables and fields, you may find it very difficult to find the correct data you are looking for (consider a table where records are never truly "deleted" but rather use an IsDeleted field that the application knows means that this is something that should never be shown to the user). And that would only be useful for read-only access - you should never update another application's database directly since you don't know it's "business rules".

Finally, some programs offer nothing at all. The best you can do in such a case is use some sort of "screen scraping" to read the information directly from what's shown to the user.

The point is, there's no magic answer that covers all applications. You are going to have to research each application individually to find out what interfaces they offer (if any) to a third party developer. It all starts with Google.
 
Thank you very much! I really appreciate everyone input on this!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top