visual basic user defined data types 
Author Message
 visual basic user defined data types

I know how to read data from a database and manipulate it.

I have a database base FName, Lname, and Salary fields.  They are
 strings and integer fields.

I declared my datatype as
Private Type EmployeeList
    Employee_LName As String
    Employee_FName As String
    Employee_Salary As Integer
End Type

I am having trouble loading this into an array.  Can someone
please give me an idea.

thanks.

* Sent from RemarQ http://www.*-*-*.com/ The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



Tue, 27 Aug 2002 03:00:00 GMT  
 visual basic user defined data types
Don't use an array, use a collection!

Place this User Defined Datatype into a Class module and do offer it through
a collection to the rest of your project.

please visit http://www.vdeveloper.com

--
-------------------------------------------------------------
maxx

www.vdeveloper.com
-------------------------------------------------------------


Quote:
> I know how to read data from a database and manipulate it.

> I have a database base FName, Lname, and Salary fields.  They are
>  strings and integer fields.

> I declared my datatype as
> Private Type EmployeeList
>     Employee_LName As String
>     Employee_FName As String
>     Employee_Salary As Integer
> End Type

> I am having trouble loading this into an array.  Can someone
> please give me an idea.

> thanks.

> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network
*
> The fastest and easiest way to search and participate in Usenet - Free!



Tue, 27 Aug 2002 03:00:00 GMT  
 visual basic user defined data types
This is not the best way, but will not be noticeably slower provided there
are not too may records. Best to use inside a class, so you can keep some
state about data etc

count = 0
If Not (myRS.EOF and myRS.BOF)
    With myRS
        While Not .EOF
            Redim Preserve MyAry(count) As EmployeeList
            MyAry(count).Employee_Employee = !SurName
            MyAry(count).Employee_FName = !First_Name
            MyAry(count).Employee_Salary = !Salary
            count = count + 1
            .MoveNext
        Wend
    End With
End If


Quote:
> I know how to read data from a database and manipulate it.

> I have a database base FName, Lname, and Salary fields.  They are
>  strings and integer fields.

> I declared my datatype as
> Private Type EmployeeList
>     Employee_LName As String
>     Employee_FName As String
>     Employee_Salary As Integer
> End Type

> I am having trouble loading this into an array.  Can someone
> please give me an idea.

> thanks.

> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network
*
> The fastest and easiest way to search and participate in Usenet - Free!



Thu, 29 Aug 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Q: variant data type with user defined data type

2. Compile error: User-defined data type not defined!

3. Microsoft Visual Basic Compile Error: Uder-defined type not defined

4. Type mismatch on user defined data type

5. User Control - User-defined type not defined

6. VB4: Help: data-alignment in user defined data types

7. Help: data-alignment in user defined data types

8. Passing Array or a user defined data type as a parameter to a storedprocedure in Oracle

9. HELP user defined data types

10. Assigning recordset recodset to a user Defined Data Type

11. binary files and user defined data types

12. Sorting arrays of user defined data type

 

 
Powered by phpBB® Forum Software