A conversion program written with ASP

xiaoxiao2021-03-06  43

As for the conversion program, this time is the second time, the first time is ................ ()

For the first time, this time I used a dynamic array (a little excitement, BS me), wrote a lot of programs with ASP, which is the first to use arrays. The condition of this conversion is to be based on the original database The value of a certain field is judged, then the problem is not difficult according to the relevant value, but the record is too much, the records in thousands of records are replaced, and there are almost more than 100 kinds. Categories, it is impossible to manually screening, which also affects the reuse after the program!

SELECT [Field] from [Name] Group by [Field] 'Field is a field in the original database

Pioneering (class) to achieve records, define two dynamic arrays

The first (AARRAY): assigns a storage space according to the total number of records (M), assigns the value in the recordset to the dynamic array.

The second (Barray): allocates the storage space to m, according to the value of the element in the first array, replacing the second array element one by one

Finally, take out the value of [Field], compare with AARRAY, find the same, replace it with Barray.

For n = 1 to m

IF oldrs ("filed") = aaarray (n) THEN

NewRS ("Field") = Barray (n)

EXIT for

END IF

NEXT

The above is my solution, if you have a better way to tell!

转载请注明原文地址:https://www.9cbs.com/read-75908.html

New Post(0)