-
[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
-
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.
-
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)
-
Re: Newbie problem
What is the problem or error?
-
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