Best way to let users run SQL? 
November 13th, 2005, 08:17 AM
| | | |
Is there any way to let users compose and run SQL from the Access interface?
If I create a new query from the Database Window, select Design View and
then View >> SQL View, I get a window from which I can compose and run SQL
queries. What I'd like to do is let users have the ability to run SQL
queries like this against imported tables.
I was thinking I could open the imported table in a form and have a textbox
in which SQL can be entered, and a button to run it.
Does Access have any built-in tools to do this kind of thing?
Thanks in advacne. | 
November 13th, 2005, 08:18 AM
| | | | re: Best way to let users run SQL?
deko wrote:[color=blue]
> Is there any way to let users compose and run SQL from the Access[/color]
interface?[color=blue]
> If I create a new query from the Database Window, select Design View[/color]
and[color=blue]
> then View >> SQL View, I get a window from which I can compose and[/color]
run SQL[color=blue]
> queries. What I'd like to do is let users have the ability to run[/color]
SQL[color=blue]
> queries like this against imported tables.
>
> I was thinking I could open the imported table in a form and have a[/color]
textbox[color=blue]
> in which SQL can be entered, and a button to run it.
>
> Does Access have any built-in tools to do this kind of thing?
>
> Thanks in advacne.[/color]
Yep.
Step 1. Go to bookstore.
Step 2. Find "Access [version] Developer's Handbook (volume I)"
Step 3. Pay for said book.
Step 4. use the code from the CD.
Step 5. Send Ken Getz & Co a thank you note for such great code.
In all seriousness, yes, it's possible. You could get the SQL
scratchpad from the book, and then you could slap a button on it that
prompts for a queryname and then saves the query. Just use
CreateQueryDef. Built-in tools for this? Umm... yeah, it's called the
QBE grid.
I almost suspect this whole post is a joke. You're not for real, are
you? I've read probably most of your posts, and I can't believe you
don't own a copy of the Developer Handbook already. Trust me - it's
$60 well spent. If you don't believe me, read the reviews. I mean,
why should you take my word for it? What do I know? Ask an MVP. At
least they can prove they know something. But if you do serious work
in Access, you're completely nuts (IMHO) not to own it. Save yourself
the trouble of reinventing the wheel. | 
November 13th, 2005, 08:23 AM
| | | | re: Best way to let users run SQL?
> I almost suspect this whole post is a joke. You're not for real, are[color=blue]
> you?[/color]
Look, chump, if you don't like my posts, don't read or reply to them. There
was nothing wrong with that question. | 
November 13th, 2005, 08:23 AM
| | | | re: Best way to let users run SQL?
I generally train advanced users in basic relational database design
and queries (and sometimes reports) in a 1-3 day tutorial. I include
loads of exercise problems focusing on their database(s) so that they
can become familiar with it. I have them use the Access query designer
to create queries, just like I do. I may also create a simple but
separate user interface for them to use so that they don't clutter the
normal UI with their queries or accidentally change one of the existing
queries. In the separate UI, I also include a number of dialogs that
they can use with their queries plus a few other features. When they
get stuck, they e-mail me their SQL and I send them back the corrected
SQL with an explanation as to what went wrong.
In the long run, the users become self-sufficient and don't need to
call me for new queries, reports and other things. Many of them enjoy
the challenge of writing their own queries. The result is a win-win
for both myself and the users.
Bill E.
deko wrote:[color=blue]
> Is there any way to let users compose and run SQL from the Access[/color]
interface?[color=blue]
> If I create a new query from the Database Window, select Design View[/color]
and[color=blue]
> then View >> SQL View, I get a window from which I can compose and[/color]
run SQL[color=blue]
> queries. What I'd like to do is let users have the ability to run[/color]
SQL[color=blue]
> queries like this against imported tables.
>
> I was thinking I could open the imported table in a form and have a[/color]
textbox[color=blue]
> in which SQL can be entered, and a button to run it.
>
> Does Access have any built-in tools to do this kind of thing?
>
> Thanks in advacne.[/color] | 
November 13th, 2005, 09:05 AM
| | | | re: Best way to let users run SQL? pietlinden@hotmail.com wrote:
[color=blue]
> But if you do serious work
> in Access, you're completely nuts (IMHO) not to own it. Save yourself
> the trouble of reinventing the wheel.[/color]
8)
I'm not sure what your problem is with the OP (I can't see his post) but
what you're saying, based on this post seems to be (Tongue firmly in
cheek!):
1) Everyone buy Kens book
2) Disband cdma!
8)
Are you sure you're not a sock puppet for Ken Getz? Hmmmmm
Just joking, BTW.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me |  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,720 network members.
|