473,386 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Access version in CreateObject

dima69
181 Expert 100+
Hi all.
I use a following code to run a procedure in another application:
Expand|Select|Wrap|Line Numbers
  1. Dim App as Access.Application
  2. set App = CreateObject("C:\MyApp.mde")
  3. App.Run "MyProc"
  4. ...
The problem is that when using CreateObject I cannot determine which version of Access will be started for App.
So if my main application supports Access2K2, and the user has Access2K installed (in addition to Access2K2), CreateObject may return Access2K application - even if calling application is running on Access2K2.

So the question is how to get the Application object of the desired Access version ?
Jul 11 '07 #1
3 3154
ADezii
8,834 Expert 8TB
Hi all.
I use a following code to run a procedure in another application:
Expand|Select|Wrap|Line Numbers
  1. Dim App as Access.Application
  2. set App = CreateObject("C:\MyApp.mde")
  3. App.Run "MyProc"
  4. ...
The problem is that when using CreateObject I cannot determine which version of Access will be started for App.
So if my main application supports Access2K2, and the user has Access2K installed (in addition to Access2K2), CreateObject may return Access2K application - even if calling application is running on Access2K2.

So the question is how to get the Application object of the desired Access version ?
  1. Your syntax for the CreateObject() Function will not work in its current context. The correct Procedure is:
    Expand|Select|Wrap|Line Numbers
    1. CreateObject(class, [servername])
    2.  
    3. Dim xlApp As Excel.Application 
    4. Set xlApp = CreateObject("Excel.Application")
  2. The specific Version is not required in the class Argument, but if you so desire, you can determine the Version by querying the Version Property of the Application Object as in:
    Expand|Select|Wrap|Line Numbers
    1. Application.Version
Jul 11 '07 #2
dima69
181 Expert 100+
  1. Your syntax for the CreateObject() Function will not work in its current context. The correct Procedure is:
    Expand|Select|Wrap|Line Numbers
    1. CreateObject(class, [servername])
    2.  
    3. Dim xlApp As Excel.Application 
    4. Set xlApp = CreateObject("Excel.Application")
  2. The specific Version is not required in the class Argument, but if you so desire, you can determine the Version by querying the Version Property of the Application Object as in:
    Expand|Select|Wrap|Line Numbers
    1. Application.Version
1. The syntax is correct. It's the alternative syntax. Moreover, It's the only one that will work in case you create Access Runtime application object (ART cannot create object without database)
2. Querying the version doesn't really help to solve the problem, if the version is not the one I need :)
Jul 11 '07 #3
ADezii
8,834 Expert 8TB
1. The syntax is correct. It's the alternative syntax. Moreover, It's the only one that will work in case you create Access Runtime application object (ART cannot create object without database)
2. Querying the version doesn't really help to solve the problem, if the version is not the one I need :)
I apologize for the misinformation - I was not aware of the alternative syntax as it relates to the Access Runtime Application Object. Thanks for the info.
Jul 11 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Si | last post by:
Hi Guys I am using this code to execute an Access VBA function from ASP: strDbName = strDataSource & "data\webjobs.mdb" Set objAccess = Server.CreateObject("Access.Application")...
2
by: Jason Burr | last post by:
I keep getting an Access is denied error using msxml4.dll I have seen a number of posts on other sites mention it and say they fixed it but not one says how they did. Here is the code that I am...
4
by: Jenni | last post by:
Hi, A quick question. I have been battling with this code all morning, please help. Here is the code Dim fPath1 As String Dim fPath2 As String fPath1 = "C:\Program Files\Microsoft...
6
by: Ecohouse | last post by:
I have a computer with XP on it. I loaded Office 97 first because I needed Access 97 for some work. I then loaded Office 2000. Everything seemed to be running fine. But I have come across a few...
2
by: Aharon Koss | last post by:
I wrote a program in microsoft access to send a report via e-mail. The e-mail works great when I run the computer from a session on my server. However, when I auto schedule the job to run the...
0
by: dkurtz | last post by:
D. Lesandrini published an article some time ago about exporting Access reports as XML, and then updating those XML reports dynamically in ..NET....
6
by: venmore | last post by:
Hi Can someone please point in the right direction. I have an XML file that gets updated every 4 hours on a web server. I can check the XML modification time in ASP and compare to the databse....
2
by: auditor.software | last post by:
Hi. I need to run a function from another database, using: Dim App as Access.Application Set App = CreateObject("C:\LibDB.mde") App.Run "MyFunc", ... I use Access2K database format, and I...
6
by: Filips Benoit | last post by:
Dear All, All 3 codes, copied from internet, triggers error 429 : ActiveX component can't create object ! No compile error. I have the reference set to Adobe Acrobat 7.0 Type Library I do not...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.