|
-
Feb 2nd, 2005, 11:12 AM
#1
Thread Starter
Frenzied Member
Is there a way (VB/Access question)
I asked this in the VB section but thought it over and this might be a better section to get this answered. I am looking to be able to call a MSAccess Module or Macro from VB while the DB is closed. Is there a way to do this possible?
Thanks for any help
-
Feb 2nd, 2005, 11:19 AM
#2
Re: Is there a way (VB/Access question)
If the database is closed, then I don't believe that anything within it is available for use. What are you trying to achieve?
-
Feb 2nd, 2005, 11:22 AM
#3
Thread Starter
Frenzied Member
Re: Is there a way (VB/Access question)
I want to be able to trigger an import of data, query process then export of completed data.
-
Feb 2nd, 2005, 12:12 PM
#4
Lively Member
Re: Is there a way (VB/Access question)
Here is a snippet of code I use to print an Access Report from a closed Access database:
Reference in VB Project the Microsoft Access 9.0 Object library.
VB Code:
Dim AccessDB As Object
On Error GoTo errRunAccessReport
Set AccessDB = CreateObject("Access.Application")
AccessDB.OpenCurrentDatabase strMDBNameAndPath
AccessDB.DoCmd.OpenReport strReport, 0, strFilter, strWhere
AccessDB.Quit 2 'acQuitSaveNone
Set AccessDB = Nothing
You may be able to modify the code to run a procedure.
-
Feb 2nd, 2005, 12:32 PM
#5
Frenzied Member
Re: Is there a way (VB/Access question)
That may work, but you're opening the database first. Access will open up.
Besoup, do you want a way to open Access, get your report, then close it, from a VB app, like dbarr does, or is the db not supposed to be opened?
Tengo mas preguntas que contestas
-
Feb 2nd, 2005, 12:36 PM
#6
Re: Is there a way (VB/Access question)
 Originally Posted by Besoup
I want to be able to trigger an import of data, query process then export of completed data.
You are not going to be able to import data into a closed database. It will have to be opened first. As salvelinus has suggested, there are ways to open it, do stuff, then close it again. I really don't see any other route you could take, and still do what you seem to need to do.
-
Feb 2nd, 2005, 01:04 PM
#7
Thread Starter
Frenzied Member
Re: Is there a way (VB/Access question)
If there is a way I can open it in the backround that would work too.
-
Feb 2nd, 2005, 08:19 PM
#8
Frenzied Member
Re: Is there a way (VB/Access question)
I don't think you can do what you want, at least w/o a lot of lower level programming in C or even ASM that I don't think is what you want.
You may be able to access (small access) the tables w/o opening Access (here I'm not sure, but sometimes get confused between the different versions of VB I work with and stuff I've read - .Net can save dbs as XML, for instance). Either way, I'm pretty sure you can't get an Access report w/o opening Access, whether or not you can access the tables w/o opening Access.
Tengo mas preguntas que contestas
-
Feb 3rd, 2005, 08:57 AM
#9
Thread Starter
Frenzied Member
Re: Is there a way (VB/Access question)
I got it to run the visibility = false its good enough for now I guess....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|