Hi
Thanks
That works, and opens doors.
I notice the SQL doesn't effect the order in the original table - If I
open it later in Access, it is still in the original order.
Is that the way SQL & Access works?.
I guess that's ok.
I've got a project up-and-running in Excel VBA
This seems very different.
cheers
Tony
David Segall - 29 Oct 2003 12:57 GMT
>Hi
>Thanks
[quoted text clipped - 3 lines]
>open it later in Access, it is still in the original order.
>Is that the way SQL & Access works?.
By definition, there is no "order" in a relational database. The order
you see is the "view" you defined in your SQL query. Access protects
you from needing to know this by always displaying a table using a
default query. That query changes when you sort on a particular
column. If you view the table using Visual Basic it is up to you to
supply the query.
>I guess that's ok.
>
>I've got a project up-and-running in Excel VBA
>This seems very different.
I'm afraid it is. Thinking in SQL is a significant departure from
thinking in other languages. It's worth learning though because, in
combination with the data bound controls in VB, it eliminates a lot of
the tedious code associated with processing records in a database.
Furthermore, your knowledge will be (almost) completely portable. Not
even Microsoft have tried to undermine the standards.
>cheers
>Tony
Gary Wilkins - 29 Oct 2003 14:39 GMT
> Hi
> Thanks
[quoted text clipped - 10 lines]
> cheers
> Tony
Think of SQL as a translator. If you don't understand the words, the
translator lets you know what *in essence* the other person is saying,
perhaps minus a few tidbits.
SQL, like a regular Access query or a VBA sort on a Pivot table in Excel
(should you write one) doesn't affect the sort order of the original because
that's not the way the data was constructed. I mean- you can build a three
level house and ladder up to the third floor to enter, but you still have to
have the foundation built, plus the first and second floors. A regular
Access query would sort the data the same way, but not effect the original
Table's data.
If you want to change the way Access displays the table data, you need to
change the sort properties of the table itself. Select the column you want
to sort by (say Surname in your case?) - Choose the A to Z button and then
close the table, saying Yes to saving the layout. Then Access will save the
sort in the table layout mode.
Everytime you want to change the sort order you have to do that. So, as you
can see the little bit of time you take to learn a few SQL commands will
really pay off. There are only about 35 to 50 commands total in the language
(I forget the exact #). They will make your database runs MILES faster (or
retrieving the data will anyway) and it makes it also much More flexible for
you - the Chief Programmer of your App.
Pick up a SQL book at your library: it isn't as daunting as you'd think. I
got a copy of SQL Server 2000 in 21 days and that was pretty much about as
straightforward as you can get. I was writing SQL code in a matter of a day
or two and feeling pretty confident with it.
Gary
TonyJeffs - 29 Oct 2003 19:23 GMT
Hi,
I'm starting to get the hang of this (compared to a day ago anyway).
I got a dbgrid control working too.
I can see that there's no advantage in sorting the original, but
curious whether I can do that with vb without coding it all myself.
I'll do as you say & get a library book.
I'm competent at XL
Coming to Access for the first time, it seems a curious design; no
"save as", no record macro...
patience, I guess!....
tony
Gary Wilkins - 30 Oct 2003 17:04 GMT
> Hi,
> I'm starting to get the hang of this (compared to a day ago anyway).
[quoted text clipped - 10 lines]
>
> tony
Some advice:
Do not record Macros!! Access supports them but they run Much slower than
VBA. If you want a form to open at startup and then do something, put the
code in VBA and leave the 'macro' window blank. Trust me.
I'm no expert w/Access by any means, nor with SQL, but my companies order
processing software is an Access/SQL front and back end. My eventual goal is
to convert the Access front-end to a VB front end and leave the data
manipulation alone.
If you have a table open, Save As is not an option. Close the table (or
unselect it) and then go to File to Save As...
I'm much better at Excel too, but I can't avoid Access and once you get the
hang of it, it starts to make sense.
Good books for Access (see if your library has them) are either:
Mastering Access 2000 Programming by Alison Balter (has a good chapter - I
think it's Chapter 7- on VBA) and forms/reports/tables/etc. I believe she
tells you why Macros should be avoided too....
Access 2000 Fundementals (I forget the author - but it's a Microsoft Press
book) for a thinner, more manageable introduction.
Both these books cover SQL in the regard of how it applies to Access. They
are great starters/reference guides.
Access 2000 Power Programming if you decide you want to become a
heavyweight. I got it and the 2nd chapter is on modifying the registry!
Heavy stuff. I'm not quite that advanced! :-)
If you perchance get stuck on an Access/SQL component- drop me a line
(remove NOSPAM from address). If I don't know the answer - I can probably
get someone who can. Also try the NG comp.lang.basic.visual.database for
VB/db related Q's. Unfortunately I don't have too much exp. with using VB to
front-end to Access (yet!).
Good luck!
Gary
TonyJeffs - 31 Oct 2003 14:43 GMT
Gary
I emailed you and it bounced.
is the latter part, at vtiboston dot etc correct?
I'm tonyjeffs at tonyjeffs dot(followed by "com")
If you send me a short emai, I'll have your correct address & reply promtly.
cheers
Tony