ASP 101 - Active Server Pages 101 - Web06
The Place ASP Developers Go!



Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash



 Top ASP 101 Stories Top ASP 101 Stories
Connections, Commands, And Procedures
What is ASP?
VBScript Classes: Part 1 of N

QUICK TIP:
VBScript's Line Continuation Character
Show All Tips >>
ASP 101 RSS Feed ASP 101 Updates


Quick Tips


Make Access Write Your SQL For You

Have you ever needed to write a SQL query that you just couldn't get right? Come to find out Access is pretty good at it. Here's how to let it do the work for you.

Fire off a copy off Access and load the database (or link to the tables) that you want to query. Next go to the 'Queries' tab and design a new query. Now create the query you want using the Access visual tools. It can be as advanced as you want... you can even draw relationships between tables, etc.

Once your query is created, simply run it and check the data to be sure it's what you were expecting. Once you've got the query correct, click on 'View' and select 'SQL View' (or right click and select it from the context menu).

All you need to do now is copy and paste the SQL statement into your ASP script. If the query needs to take any parameters you'll need to script those in, but for getting the basic structure of the query down (especially on those tricky joins) Access can make things much easier for you.

Note: For those of you using VID 6 Enterprise Edition, it will do the same thing if you've got the database tools installed. Simply create a new query and design and test it just like you would in Access. Once you're done, click the 'SQL' icon on the 'Query' toolbar to get a look at the SQL it's written.

Thanks to David Mason for giving me the kick in the butt that I needed to finally get this written.


Previous      Show All Tips      Next

If you have a tip you would like to submit, please send it to: webmaster@asp101.com.


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers