Re: To saga
- From: "Saga" <antiSpam@xxxxxxxxxxxxx>
- Date: Fri, 17 Aug 2007 10:03:48 -0500
What kind of application do you need to build?
I can offer some suggestions...
a. Use ADO when accessing a client/server (c/s) DB, like SQL Server.
b. A c/s implementation is usually accessed through a network, so
keep whatever travels on the network as short as possible. For example,
if querying for data, use the WHERE clause to limit the result set.
c. In a c/s environment, avoid opening tables, instead bring back only
the data that you need (very similar to 'b')
d. Make prudent use of Triggers. Do not use them to validate data
entered by the user. Validate user entered data in the presentation
layer. This avoid unnecessary traffic on the network.
e. To make the app flexible, use catalogs for attributes that can vary.
For example, if the user has to enter an id number and the document
where it came from, it could be a driver's license, passport, gov. id
or many others. Allowing the administrative user to define this list
in a table given the user more flexibility.
f. Do not create a recordset when executing SQL statements that don't
return results, like INSERT, DELETE and UPDATE (among others).
g. When possible, use stored procedures and have them do as much
work as possible.
h. Avoid using the sa admin user in SQL Server. Instread create a
different user that your app can use and give that user the necessary
permission that your app needs.
i. If you build your SQL within your VB code and the data being queried
or saved is text (varchar/char, etc) always replace the single quote ( ' )
for two single quotes ( '' = chr$(39) & chr$(39) )
j. When embedding dates in your SQL that is built in your VB code,
always use the yyyy-mm-dd format, regardless of your regional settings.
k. When doing the same with numbers, make sure the number does not
have a thousands seperator and that the decimal seperator is a dot.
l. Avoid all the problems mentioned in "i", "j", and "k" by using parameters.
(This is the parameter object in ADO).
Best of luck! Saga
--
"teresacab" <teresacab@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0D7A4B18-877F-4C1D-9D73-6519EBBE4F3D@xxxxxxxxxxxxxxxx
Saga hello
the app I need to build is in visual basic 6.0 data base sql server 7.0 and
2000.
I hope yuor answer. Thanks.
Teresa
Your question is very broad. One thing is to have best practices for
programming
in VB6 and another very different to have best practices while building a
client/
server application.
Your example is a good one. You should always try to avoid hard coding items
like disk drives, but this also applies to any other settings that your app
may need.
Other general best practice include making the application consistent so that
the user will feel comfortable in all its screens. Whenever possible, follow a
generally accepted UI design. And of course, a classic, do not use the End
statement to end your program :-).
One possible best practice for client/server is to validate your user input in
the presentation layer and not at theback end, but some may disagree.
If you explain in more detail what sort of app you need to build, including
the
data base that you will be using perhaps others can provide a more concise
answer to your question.
Regards, Saga
--
"teresacab" <teresacab@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:0519C44A-EAFE-4D34-8597-523490C4CC0F@xxxxxxxxxxxxxxxx
Hello my name is teresa from chile
I need to know which should be the best practices to programming in visual
basic 6.0 for aplications client server. Thanks.
Sorry my english...
For example:
Not use directlty in the code units of disc
d:
c:
.
- References:
- To saga
- From: teresacab
- To saga
- Prev by Date: Re: compare two listviews
- Next by Date: Re: compare two listviews
- Previous by thread: To saga
- Next by thread: Re: VB6 and Crystal Reports 11 works slowly on Vista.
- Index(es):
Relevant Pages
|