|
-
Dec 5th, 2005, 03:28 PM
#1
Thread Starter
New Member
[resolve]Newbie problem
Hi
First I m more that a newbie un .net I only learn from 1 book and some tutorials
but now
I need to print from ms access (Repport1)every week day at 5 am
for the time programming I will use MS Scheduler
so it has to start (that where i need your help)
a soft that open Access and print a specific repport then it close access and it self
So i'l take every help i can get
Thx
Last edited by GGama; Dec 6th, 2005 at 01:29 PM.
-
Dec 5th, 2005, 05:26 PM
#2
Re: Newbie problem
I suggest that you search MSDN for "automation access" (without quotes). Microsoft use the term "Office Automation" for remote controlling an instance of an Office application. MSDN will give you the basics on how to create an instance, interact with it and then close it. It's then up to you to use the Access VB reference to work out exactly what objects and members you need to use to achieve your specific aim.
-
Dec 6th, 2005, 09:40 AM
#3
Thread Starter
New Member
Re: Newbie problem
ok Automate Access is what I need
thx
Now i can open the Database but i have problem
with the repport thing
Dim Rapport As String
Repport = "DetailRepport"
System.Runtime.InteropServices.Marshal.BindToMoniker("c:\\scaledata.mdb")
DoCmd.OpenReport(Repport, acViewPreview)
-
Dec 6th, 2005, 10:25 AM
#4
Re: Newbie problem
What is the problem or error?
-
Dec 6th, 2005, 11:08 AM
#5
Thread Starter
New Member
Re: Newbie problem
i went with this methode instead
Private Sub FormMenu_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim oAccess As Access.Application
Dim Rapport As String
Rapport = "E_Inventaire détaillé"
' Start a new instance of Access for Automation:
oAccess = New Access.ApplicationClass
' Open a database in exclusive mode:
oAccess.OpenCurrentDatabase(filepath:="c:\scaledata.mdb", Exclusive:=True)
'Print le Rapport
oAccess.DoCmd.OpenReport(Rapport, Access.AcView.acViewNormal)
'Fermer La BD
oAccess.CloseCurrentDatabase()
Me.Close()
but it leave access open at the end
i just need to find out how to close access and it will be done
kill C:\Program Files\Microsoft Office\Office10 wont work
DONE !!
added
oAccess.Quit(Access.AcQuitOption.acQuitSaveNone)
Thx
Last edited by GGama; Dec 6th, 2005 at 01:29 PM.
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
|