|
-
Sep 7th, 2003, 05:48 PM
#1
Thread Starter
Addicted Member
File-less Database
Im hoping someone can help me out here.
I am looking to create a virtual type database that is created on runtime and is destroyed when the program ends.
After looking at my program I figure this would be the best way to handle the data rather then trying to play around with a bunch of arrays and "if then"s.
I have done it before with VBScript in ASP but cannot find any articles for VB6 in regards to this.
If anyone can help me out it would be great.
Incase you dont know what Im talking about, this is a snip of what I was doing in ASP:
Code:
<object runat="Server" scope="Application" id="rstActiveUsers" progid="ADODB.Recordset">
</object>
Const adInteger = 3
Const adVarChar = 200
Const adDate = 7
rstActiveUsers.Fields.Append "id", 3
rstActiveUsers.Fields.Append "nickname", adVarChar, 25
rstActiveUsers.Fields.Append "area", adVarChar, 75
-
Sep 7th, 2003, 06:07 PM
#2
Frenzied Member
u could make your own type
VB Code:
Type EmployeeRecord ' Create user-defined type.
ID As Integer ' Define elements of data type.
Name As String * 20
Address As String * 30
Phone As Long
HireDate As Date
End Type
Dim MyRecord As EmployeeRecord ' Declare variable
Private Sub Command1_Click()
MyRecord.ID = 12003 ' Assign a value to an element.
MsgBox MyRecord.ID
End Suc
-
Sep 8th, 2003, 12:57 AM
#3
There is very little difference between your asp code and the vb code. Depending on your needs, you may need to increase the scope of the variables used below. They are private to a form.
VB Code:
Option Explicit
Private Const adInteger = 3
Private Const adVarChar = 200
Private Const adDate = 7
Private rstActiveUsers As ADODB.Recordset
Private Sub Form_Load()
Set rstActiveUsers = New ADODB.Recordset
rstActiveUsers.Fields.Append "id", adinteger
rstActiveUsers.Fields.Append "nickname", adVarChar, 25
rstActiveUsers.Fields.Append "area", adVarChar, 75
rstActiveUsers.Open
End Sub
Last edited by brucevde; Sep 8th, 2003 at 01:01 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|