Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Temporary table under visual basic

Status
Not open for further replies.

Madbull

IS-IT--Management
May 3, 2005
26
0
0
BE
Hello yall.
I know when programming under Delphi that you can declare in your codesource temp table wich are stored in the memory on the local machine.You use the table then when you don't need it you remove it from memory.That's great!
My problem is that i can't find anywhere a tutorial that shows me how to declare and use temp table under vb.I don't even know if it is possible,i guess it must be but can't find infos.
If someone can help me this would be great.
Thanks in advance
 
Are you talking about a temp table in the database or a data structure that you use in code? Something like an array? or more like a disconnected ADO recordset perhaps?
 
I am talking about a data structure in my code.
Under delphi, you can do something like that:

dim tempTable as temp table {
field1 as string
field2 as integer
etc...
}
That way you can declare as many instance as need it (as long as memory isnt full) then drop them when you no longer need them.
 
Or maybe a user defined type

Type tempTable
field1 as string
field2 as integer
End Type

[...]

Dim MyUDT as tempTable
Dim FixedArrayOfUDT(10) as tempTable
Dim DynamicArrayOfUDT() as tempTable

etc..
 
Is it the only solution.
I'll try this if there is no other way to do it.
Thanks for your help guys
 
Afraid so, Madbull. I would lean toward using a class because it is more scalable than at User Defined Type. That said, you may not need more than what the UDT provides.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top