how 2 use RECORDSET?

JinaneKarhani

Registered User.
Local time
Today, 12:38
Joined
Aug 31, 2004
Messages
15
Hello there,
I’ve been told that I can use the “Recordset” & “Recorset Type” in order to create table with multiple same type fields but with different captions, & in order to do this I must add the ADO 6 or DAO 6 library , how? I don’t how to add the ADO or DAO 6 for only I havr the version 5.1, so from where can I download it ??? & can anyone give me the structure of the recordset by an example ? This would be soooo much help 4 me.
Jinane
 
Jinane,

Not sure how you would use a recordset to "Create a table with multiple same type fields".
You can use recordsets to add/modify/view the contents of tables.

Can you be more specific as to what you want to do?

Wayne
 
thx 4 yr reply Wayne

Really so it doesn't help in the creation of multi-same type fields?

Here's my target tables's structure :

i have an autonb field
a field "A" text 4
Nb of fields (this depends from other table RECORDS) X with Nb-->integer type
A field Note As Text 130

..
i will create a nb of tables like this but each time this X will change.
 
Jinane,

Still unclear of what you need to do.

Recordsets are used like this:

Code:
'
' Loop through all records and change SomeField from xxx to yyy
'
Dim dbs As DAO.Database
Dim rst As DAO.RecordSet

Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("SomeTable")

While Not rst.EOF and Not rst.BOF
   If rst!SomeField = "xxx" Then
      rst.Edit
      rst.SomeField = "yyy"
      rst.Update
   End If
   rst.MoveNext
   Wend

I don't see how that helps you. Need more specific info on your
table structure and what you are trying to do.

Wayne
 
Thx Wayne, this is not what i wanted
Here's my target tables's structure :

i have an autonb field
a field "A" --->Type text 4
Nb of fields (this depends from other table RECORDS) X with Nb-->integer type
A field Note As Text 130

..
i will create a nb of tables like this but each time this X will change.
X is the nb of records (DCount) of another table , say B.

Jinan
 
Jinane,

Sorry, language barrier ...


Code:
'
' Insert 'x' records into some table
'
Dim dbs As DAO.Database
Dim rst As DAO.RecordSet
Dim i As Long
Dim x As Long

Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("SomeTable")

For i = 1 to x
   rst.AddNew
   rst.SomeField = "yyy"
   SomeOtherField = "zzz"
   rst.Update
   Next i

Wayne
 
well i'm french educated.. really language barrier..

i'll still wait!!
 

Users who are viewing this thread

Back
Top Bottom