Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Probelm in Rs
Message
From
08/02/2000 21:36:30
 
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Title:
Miscellaneous
Thread ID:
00327898
Message ID:
00329269
Views:
27
Here is the code

Dim Rs As ADODB.Recordset
Dim Str As String
Dim rstMemory As ADODB.Recordset

'================================================= 'Create an in memory recordset to build the view for the grid
=================================================
Set rstMemory = New ADODB.Recordset
With rstMemory
.CursorLocation = adUseClient
.LockType = adLockPessimistic
.Fields.Append "Entity", adVarChar, 50
.Fields.Append "EntityCode", adVarChar, 50
.Fields.Append "Total", adDouble
.Fields.Append "Price", adDouble
.Open
End With
================================================= 'Fill the In-memory recordset with data
=================================================
rstMemory.AddNew
rstMemory!Entity = "This is the Entity"
rstMemory!EntityCode = "Code"
rstMemory.Fields("Total") = 1.23
rstMemory.Fields("Price") = 4.56
rstMemory.Update

CnConnection

Str = "Select * From rstMemory"
Call RsConnection(Str, Rs)

Private Sub CnConnection()
Set MasterCn = New ADODB.Connection
MasterCn.Provider = "Microsoft.jet.OLEDB.3.51"
MasterCn.ConnectionString = " " 'Mdb Path
MasterCn.Open
End Sub

Private Sub RsConnection(RsStr As String, RsName As ADODB.Recordset)
Set RsName = New ADODB.Recordset
With RsName
.ActiveConnection = MasterCn
.CursorType = adOpenDynamic
.CursorLocation = adUseServer
.LockType = adLockOptimistic
.Source = RsStr
.Open 'At this line it gives me error rstMemory not found
End With
End Sub

Amol
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform