Simple C# Question

S

Sam

I have a Microsoft Access report which I have automated
using C#. When the report opens (via DoCmd.OpenReport) I
am confronted with several prompts for parameters
(example: "Please enter today's date"). What I would like
to do is handle each and every one of these prompts
programmatically with C#. Modifying the original Access
report (with its related queries, etc.) is not an option.
I just want to send values from my C# app to the MS
Access parameter prompts, that's it. Any ideas?
 
D

Drebin

lol :blush:) You should ask for your money back!!

For this question, you might want to try an MSAccess group and find out how
you'd normally send arguments and Access report..
 
S

Sam

I thought about doing that, but this really is a C#
question. It's all about the C# DoCmd.OpenReport syntax.
 
J

Jon Skeet

Sam said:
I thought about doing that, but this really is a C#
question. It's all about the C# DoCmd.OpenReport syntax.

Strictly speaking, that's not a C# question at all. C# is a language,
not a platform.

It's either a general .NET question, or (more specifically) a question
about the specific class you're using. (I can't find any methods called
OpenReport in MSDN, so I'm assuming it's a method in a specific Access
class or the like, in which case a newsgroup dealing with that
particular class would be a better bet.)
 
J

Jo

I used to get those problems when I was using VB or delphi to use access.
Just means that your report is written without taking into account the
integrity of you data that you are trying to display. if you Dbl click the
report in Access you should not get any pompts to enter something that it
needs to do some computation.
A report in access is simply a reflection/view of your data in the "pseudo"
database. (I call Access MDB's pseudo databases for obvious reasons...)

To answer your question : and this is how I got around it.
Set up a temp table and reference that from your report to get the values
you need.
populate the temp table before calling the report from c# and the clear the
table when you are done.

hope it helps
 
J

Jon Skeet

Sam said:
You must be referring to interop.DAO...I'm referring to
the interop.access namespace.

That definitely sounds like it's a question for an Access newsgroup
then.
 
S

Sam

Jo,

Thanks for responding. Unfortunately, everyone seems to
be missing the whole point of my post. I need to
programmatically handle an application's dialog boxes (in
this case, it just happens to be MS Access). I need to
take data (stored in variables in the C# code) and
programmatically pass it to these dialog boxes. Then, I
need to programmatically click "ok" on these dialog
boxes. I find it hard to believe that this is so
complicated. There's C# code to open an Access DB.
There's C# code to open an Access report. Why can't there
be code to handle a simple Access dialog/input box???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top