Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is wrong in this code ?
Message
 
À
09/10/2001 15:53:15
Jason Dalio
Northern Interior Regional Health Board
Prince George, Colombie Britannique, Canada
Information générale
Forum:
Internet
Catégorie:
Active Server Page
Divers
Thread ID:
00561454
Message ID:
00566202
Vues:
34
>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
Fil
Voir

Click here to load this message in the networking platform