Mike said:
I've started moving some of my tables to a SQL Server
backend and created Views in SQL Server. Is there a way
to pass a form field to the SQL Server view so that it
only returns a partial set of records to increase speed
and reduce network traffic.
The same and good designs techniques you used in ms-access to reduce network
traffic also applies to sql server. It would be plain silly to load up a
instant teller machine with everyone's name and account number , AND THEN
ASK for your account number to work on!
Hence, I sure you never did just blindly load up a ms-access form attached
to a table without regards to what names you load into the form...right?
Also, just throwing up a form with a bunch of names and then telling the
user to have at it is not very user friendly anyway. This design approach
don't make sense when using JET, or sql server.
So, the best approach is to simply ask the user what they want BEFORE YOU
launch the form. So, ask for that invoice number, or that name or whatever.
You then simply launch the form to THAT NAME or THAT INVOICE number or
whatever. If you use the "where clause" of the OpenForm, then ONLY that one
record will be retrieved to the form, and thus no network traffic is wasted.
It is interesting to note that having some nice prompts to ask the user what
they want is not only more user friendly, but it also reduces network
traffic also! This is a real win win situation. So, your solution here is
to simply not load up forms with more data then they need. I would be
surprised if anyone reading this could not agree more that letting the user
edit JUST the record they need is more efficient, and more user friendly
then a form with a zillion records, and the user has to somehow wade their
way through that large number of records.
dim strInvoiceNum as string
strInvoiceNum = InputBox("What invoice to edit")
docmd.OpenForm "frmInvoice",,,"InvoicdID = " & strInvoiceNum
The above shows how the OpenForm can be used with the "where" clause.
Here is some screen shots of some search screens to give you even more
ideas:
http://www.attcanada.net/~kallal.msn/Search/index.html
Hence, not overloading forms explains how us developers write applications
for 10, or 15 users and small tables in the 50,000 record range but do NOT
need sql server.
These table sizes are absolute nothing for ms-access, and not even a sweat
breaks out. These efficient designs are why ms-access can run blinding fast
without the need for sql server on a network. However, the above ideas and
concepts apply equally well to sql server.
Sql server does not increase the performance of your application all by its
self unless YOU design your application as such. We see tons of posts about
how people moved their data to sql server, and performance actually drops.
SQL server is far more powerful and scaleable then the JET/mdb database
engine, but in both cases designs that respect the network are required.
Good luck!