View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default Could some one please help me to interpret the following syntax

This probably isn't the best newsgroup to be asking about SQL.

Since I know a fair bit about SQL, I'll try to answer what I can.
Im getting simple about it. SQL is a huge topic. There are books with 1,000
pages which don't cover everything.

SQL stands for Structured Query Language.
There are 4 ways to work with data: Select, Insert, Update, Delete.

The syntax of a basic Select statement goes a little like:
Select <column name
From <table/view
Where <criteria

As an example, your SQL statement criteria could evaluate to:
JobNo = '12345'

Strings are usually enclosed by single quotes, depending on the database.

Note that most databases are not made up as a single MDB file.
ADO acts as a standard interface to a variety of databases - those which
provide support for OLEDB.

Given it's an Access database, it's quite likely you'll find the file
location as a property of the Connection object. It might even be in the
strADOName variable.


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Augustus" wrote in message
...
I am asked to reprogram a Excel/VBA program, and need help
regarding the following code which querying an Access
Database on the server:


Set Conn = CreateObject("ADODB.Connection")
Conn.Open strADOName
strSQL = "SELECT JobNo FROM tblPourItem"
strSQL = strSQL & " WHERE JobNo = '" & strJobNo & "'"


Could someone please direct me to a source where I could
get information relating to querying external DataBase,
like in the above example, what's the function of SELECT?

Especially this line:
strSQL = strSQL & " WHERE JobNo = '" & strJobNo & "'"
WHat is the purpose of ' ?

Also, is there a function in ADO that would let me
retrieve the file's path? Cause I need to find out the
date last modified to Conn(in the example, which is
located on the sever).