To modify your ASP, it is necessary to remove any references to and processing of the objects you created before.

Instead, you will create your object and call the appropriate method.  Using the CreateObject function of the Server, it takes a String that is in two parts:  the first part is the name of the DLL, the second is the name of the class within the DLL.

When I created my VB Project, I named the project "CIS237" and the Class Module "Addresses."  When I compile the DLL, the name of it (by default) will be CIS237.DLL, after the name of my project.  So, to use the Addresses class, I use the following statement:
[
][
]
Set objAddresses = Server.CreateObject("CIS237.Addresses")
[
][
] For anyone not familiar with the dot notation, this would make an excellent Bulleting Board topic. View List [
] Test the data type of the return variable. If it is an array, you will loop through it in a similar manner is you did the RecordSet. If it is a String, then you will know that records were not returned. There are major differences, though, in looping through an array versus looping through an recordset. Especially an array created using GetRows. A recordset contains rows and columns. Each row represents all the detail for a specific record. Each column represents a field. [
][
]
FirstName   LastName
John        Smith
Jane        Doe
[
][
] In an array created using GetRows, the rows and columns are swapped! [
][
]
FirstName John  Jane
LastName  Smith Doe
[
][
] Each column represents all the detail for a specific record. Each row represents a field. To determine if we have an array, we use the IsArray function, which returns true if the variable is an array. [
][
]
If IsArray(varResult) Then
[
][
] To determine how many records we got back, we use the UBound function. This function takes two arguments: the array variable and the dimension number. The first dimension represents the rows (fields), the second dimension represents the columns (records). The following line of code will tell us how many records were returned based on the size of the second dimension: [
][
]
intRecords = UBound(varResult, 2)
[
][
] To get a value from the array, we pass it the field number and the record number we want: [
][
]
strFirstName = varResult(0, intRecordNbr)
[
][
] This assumes that FirstName is the first field in our recordset. How do we know that for a fact? The order of the fields will be as they were specified in the SQL statement. In the ViewDetails page, I did "SELECT *" which automatically selected all field from the table. I could get a way with it because I was using a RecordSet. RecordSets have a method that allows you to get the field value when you pass the field name. We don't have that luxury with an array. Elements in an array are referred to strictly by number, so we have to be certain of the position of the field in the array. In the GetAddress method of the DLL, I explicitly list the fields. Now I know the order in which they will return. Two additional notes before we move on: Arrays are zero based. This means that the first item is indexed at 0, the second at 1, etc. A successful programmer must be able to keep track of what each part of an application is doing. This is critical at this stage of the development of our project. The ASP has to know the order of the fields in the array created by the DLL. View Detail, Edit Detail [
] Here, the DLL method will instantiate and populate a copy of our object, then return that to our ASP. [
] Update Detail [
] This works the same as the other pages, except that you already know that the data type returned will be an Integer. [
] Examples [
] The following links will show you the modifed ASP pages that use the new DLL. [
] View List View Detail Edit Detail Update [
] [
]