Information générale
Catégorie:
Active Server Page
>Regarding not wanting all of the records returned if you are only trying to do an AddNew:
>
>I like using "SELECT data FROM myTable WHERE 0 = 1;"
>
>Since 0 can never equal1 it won't return any rows. Also, you are dealing with a boolean compare so the resource i less (although the resource is fairly inconsequential).
Jason;
My approach to adding a new record using AddNew, is the following:
Use the primary key of the top of file (if data is in a table) or record you are looking at, and put that into your Select statement, to return that one record from the table. If the user hits Cancel, return to that record last viewed.
I also use the MaxLength property of a text box with the following code:
maxlength= < %= oRS(PartName).definedsize % >
This allows dynamic resizing of the MaxLength property so if you increase the field length of an element of a table you do not have to go back in and change the code by hand. SQL Server likes that - otherwise you get Error: Microsoft OLE DB Provider for ODBC Drivers error 80040e21.
To each his own.
Tom
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement