473,399 Members | 4,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Recordset addnew etc...

I have a question regarding how i can refer to the fields that I want
to add into my dataset

Each of my fields in my rawtext file that I am going to import appears
in the form:

"FieldName:FieldValue"

with a comma between each ietm in a record.

I'm happy about dividing it all up but I want to do something like
this...

rs1.AddNew
For i = 1 To intCnt
rs1!(myarray(1, i)) = myarray(2, i)
Next
rs1.Update

So myarrary(1,i) contains the fieldname and myarray(2,i) contains the
contents.

incnt contains the the count of fields in a particular row.

The reason for this idea is that i might only get some of the total
possible fields in my data record...

I know that i can refer to the fieldname by name but here i tried to
use a variable instead and it just doesn't want to know...

What is the correct form - if any?

Thanks,

Rob.

Sep 25 '07 #1
5 2333
Anyone? I've tried loads of ideas but it's not getting me anywhere.

I've tried:

rs1![myarray(1,i)] = myarray(2,i)

rs1!(myarray(1,i)) = myarray(2,i)

rs1!("myarray(1,i)") = myarray(2,i)

it's driving me mad - what am i doing wrong?

Thanks,

Rob.

On 25 Sep, 13:06, dkintheuk <rmcgre...@firenet.uk.comwrote:
I have a question regarding how i can refer to the fields that I want
to add into my dataset

Each of my fields in my rawtext file that I am going to import appears
in the form:

"FieldName:FieldValue"

with a comma between each ietm in a record.

I'm happy about dividing it all up but I want to do something like
this...

rs1.AddNew
For i = 1 To intCnt
rs1!(myarray(1, i)) = myarray(2, i)
Next
rs1.Update

So myarrary(1,i) contains the fieldname and myarray(2,i) contains the
contents.

incnt contains the the count of fields in a particular row.

The reason for this idea is that i might only get some of the total
possible fields in my data record...

I know that i can refer to the fieldname by name but here i tried to
use a variable instead and it just doesn't want to know...

What is the correct form - if any?

Thanks,

Rob.

Sep 25 '07 #2
On Sep 25, 7:06 am, dkintheuk <rmcgre...@firenet.uk.comwrote:
I have a question regarding how i can refer to the fields that I want
to add into my dataset

Each of my fields in my rawtext file that I am going to import appears
in the form:

"FieldName:FieldValue"

with a comma between each ietm in a record.

I'm happy about dividing it all up but I want to do something like
this...

rs1.AddNew
For i = 1 To intCnt
rs1!(myarray(1, i)) = myarray(2, i)
Next
rs1.Update

So myarrary(1,i) contains the fieldname and myarray(2,i) contains the
contents.

incnt contains the the count of fields in a particular row.

The reason for this idea is that i might only get some of the total
possible fields in my data record...

I know that i can refer to the fieldname by name but here i tried to
use a variable instead and it just doesn't want to know...

What is the correct form - if any?

Thanks,

Rob.
I'm still not clear on exactly what you are trying to do... You have
a comma-delimited text file and you want to import it. What method
are you going to use to import it? You could open it with the OPEN
command and read it one line at a time until you reach its EOF. If
you are unsure if all of the possible fields will be represented, then
you could use a switch statement to select the proper field or
rs.fields("fieldname"), replacing "fieldname" with the variable
holding the fieldname. I don't know what you are trying to do with
the array...

Sep 25 '07 #3
On 25 Sep, 14:38, OldPro <rrossk...@sbcglobal.netwrote:
On Sep 25, 7:06 am, dkintheuk <rmcgre...@firenet.uk.comwrote:


I have a question regarding how i can refer to the fields that I want
to add into my dataset
Each of my fields in my rawtext file that I am going to import appears
in the form:
"FieldName:FieldValue"
with a comma between each ietm in a record.
I'm happy about dividing it all up but I want to do something like
this...
rs1.AddNew
For i = 1 To intCnt
rs1!(myarray(1, i)) = myarray(2, i)
Next
rs1.Update
So myarrary(1,i) contains the fieldname and myarray(2,i) contains the
contents.
incnt contains the the count of fields in a particular row.
The reason for this idea is that i might only get some of the total
possible fields in my data record...
I know that i can refer to the fieldname by name but here i tried to
use a variable instead and it just doesn't want to know...
What is the correct form - if any?
Thanks,
Rob.

I'm still not clear on exactly what you are trying to do... You have
a comma-delimited text file and you want to import it. What method
are you going to use to import it? You could open it with the OPEN
command and read it one line at a time until you reach its EOF. If
you are unsure if all of the possible fields will be represented, then
you could use a switch statement to select the proper field or
rs.fields("fieldname"), replacing "fieldname" with the variable
holding the fieldname. I don't know what you are trying to do with
the array...- Hide quoted text -

- Show quoted text -
It's not the import that is the problem i can go from a text file that
looks like this...

Fieldname1:FieldValue1,FieldName2:FieldValue2,Fiel dName3:FieldValue3

Each row can contain any number of records but i have the full set of
possible fieldnames...

I'm converting this to an array myarray(a,b)

a is always 1 or 2 and this relates to fieldname or fieldvalue

So then I can call the fieldnames with myarray(1,b) and the
fieldvalues with myarray(2,b)

I'm gonna try what you mentioned rs.fields(myarray(1,b)) and see how
far i get.

Thanks,

Rob.

Sep 25 '07 #4
On 25 Sep, 14:38, OldPro <rrossk...@sbcglobal.netwrote:
On Sep 25, 7:06 am, dkintheuk <rmcgre...@firenet.uk.comwrote:


I have a question regarding how i can refer to the fields that I want
to add into my dataset
Each of my fields in my rawtext file that I am going to import appears
in the form:
"FieldName:FieldValue"
with a comma between each ietm in a record.
I'm happy about dividing it all up but I want to do something like
this...
rs1.AddNew
For i = 1 To intCnt
rs1!(myarray(1, i)) = myarray(2, i)
Next
rs1.Update
So myarrary(1,i) contains the fieldname and myarray(2,i) contains the
contents.
incnt contains the the count of fields in a particular row.
The reason for this idea is that i might only get some of the total
possible fields in my data record...
I know that i can refer to the fieldname by name but here i tried to
use a variable instead and it just doesn't want to know...
What is the correct form - if any?
Thanks,
Rob.

I'm still not clear on exactly what you are trying to do... You have
a comma-delimited text file and you want to import it. What method
are you going to use to import it? You could open it with the OPEN
command and read it one line at a time until you reach its EOF. If
you are unsure if all of the possible fields will be represented, then
you could use a switch statement to select the proper field or
rs.fields("fieldname"), replacing "fieldname" with the variable
holding the fieldname. I don't know what you are trying to do with
the array...- Hide quoted text -

- Show quoted text -
In fact i can already tell you that it works perfectly - i just
couldn't get the syntax right to refer correctly to the fieldname in
the recordset rs1 by a variable - that has sussed it.

CHeers,

Rob.

Sep 25 '07 #5
On Tue, 25 Sep 2007 06:27:55 -0700, dkintheuk
<rm*******@firenet.uk.comwrote:

rs1.Fields(myarray(1,i)) = myarray(2,i)

-Tom.

>Anyone? I've tried loads of ideas but it's not getting me anywhere.

I've tried:

rs1![myarray(1,i)] = myarray(2,i)

rs1!(myarray(1,i)) = myarray(2,i)

rs1!("myarray(1,i)") = myarray(2,i)

it's driving me mad - what am i doing wrong?

Thanks,

Rob.

On 25 Sep, 13:06, dkintheuk <rmcgre...@firenet.uk.comwrote:
>I have a question regarding how i can refer to the fields that I want
to add into my dataset

Each of my fields in my rawtext file that I am going to import appears
in the form:

"FieldName:FieldValue"

with a comma between each ietm in a record.

I'm happy about dividing it all up but I want to do something like
this...

rs1.AddNew
For i = 1 To intCnt
rs1!(myarray(1, i)) = myarray(2, i)
Next
rs1.Update

So myarrary(1,i) contains the fieldname and myarray(2,i) contains the
contents.

incnt contains the the count of fields in a particular row.

The reason for this idea is that i might only get some of the total
possible fields in my data record...

I know that i can refer to the fieldname by name but here i tried to
use a variable instead and it just doesn't want to know...

What is the correct form - if any?

Thanks,

Rob.
Sep 25 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Rob Meade | last post by:
evenin' k - I've got a recordset that I'm dumping another recordset into - because the source comes from a database that I cant update (probably makes more sense to me that bit) - anyway, I need...
0
by: belacyrf | last post by:
Here's the code: ------------------------------------------------------------------- accessID = request("accessID") strSQL = "SELECT * From PendingAccRequests Where AccessID = "&accessID ...
11
by: Ian Ornstein | last post by:
in posting http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&newwindow=1&selm=bmEK9.43452%24lj.1060600%40read1.cgocable.net Lyle showed us that an ADODB.Recordset can be created and attached to a...
2
by: Harold | last post by:
Sat I have a customers table with the fields CustomerID and Customer and I use the recordset.addnew method to add a new record to the table. What is the best way to get the CustomerID of the new...
13
by: Jan | last post by:
Hi I have a database that I use to keep track of the sales promotions that we send to companies. I normally send a mailing based on a subset of the companies in the database (found using the...
5
by: Fabrice | last post by:
Hello everybody, I'm working with Access 2002. I have to import Data from a Foxpro table that contains 25000 records in an Access table. I have a couple of restrictions placed on me for the...
5
by: tony010409020622 | last post by:
I just spent 4 months taking a dotnet class where i learned very little. One of the things I did not learn is this: What are the dotnet equivilents of commands such as: Adodc1.Recordset.AddNew...
4
by: darkforcesjedi | last post by:
Creating a connectionless recordset in ADO is simple enough, but how do you do it in DAO? I want a recordset stored in memory so I can filter/sort it easily. If I create a table I can make it work,...
0
ADezii
by: ADezii | last post by:
When you create an ADO Recordset, you should have some idea as to what functionality the Recordset does/does not provide. Some critical questions may, and should, be: Can I add New Records to the...
2
by: Kamil | last post by:
Hi. Is it possible to add new record to my recordset which is based on a query? I want to use this recordset only for temp starage of data, and I don't want to update values from this recordset...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.