|
|
Free SQL TutorialsIn these tutorials, I assume that you have a little knowledge about opening connections via ODBC or OLEDB and that you know where to use the SQL statement. Below is one way of returning a recordset from a database where you have a system DSN setup on the server. The text in red is the SQL Statement. That will be the focus of these tutorials. set conntemp=server.createobject("adodb.connection") conntemp.open "DSN=SYSTEM_DSN_NAME" set rstemp=conntemp.execute("SELECT * FROM TableName WHERE FieldName='TEXT'") Now you can get all sorts of different results from your database simply by changing the SQL statement. See links below for different variations of the SQL Statement. I used to get all my results from the relational databases by programming. UNDERSTAND what you can do by learning some more SQL: You can cut down on some programming by at least 10 fold!!! Let the relational database do what it was built to do! Just by knowing a little more SQL, you can write one SQL query and avoid all those extra database connections. Structured Query Language TutorialsCommon SQLView records--Use this code for reports Insert new record into a table--Use this code for adding records Update Records--Use this code for making changes to your records Delete Records--Use this code for deleting records Joins--Pulling Records from more than one table Inner Joins Left Outer Joins Right Outer Joins Full Joins Cross Joins Adding to the basic statements--for the Common SQL and for JOINS The WHERE clause LIKE EQUAL(=) NOT EQUAL (<>)/ LESS THAN (<)/ GREATER THAN (>) AND, OR, NOT The ORDER BY clause DISTINCT Aliasing COUNT The GROUP BY clause FAQs/Issues Dealing with dates--SQL Server VS MS Access Reserved words--don't use as field or table names Troubleshooting your SQL Statement Inserting quotes in the database Helpful Links http://www.4guysfromrolla.com/webtech/sqlguru/ http://www.sqlcourse.com/ http://www.sqlcourse2.com/ http://www.4guysfromrolla.com/webtech/datamodeling.shtml http://www.programmingtutorials.com http://www.thelinkzone.com http://www.dcs.napier.ac.uk/~andrew/sql/ http://sqlwire.com |