473,767 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is it possible to store table field names in array then use to update table

Hi I am using WinXP and Access 2003
Is it possible to store the field names of a table in an array and then
loop through the array and update the table using the field names stored
in the array? I can't figure out the coding to accomplish this.
I have an Excel application that is a monster and it has become too much
to maintain and test. I didn't write it but i support it. I am trying to
convert this application to Access and it is not as easy as it sounds.
Lots of field names and lots of tables. I have actually exceeded the
maximum number of field names in a table causing me to breakdown the
data and create more tables...

TIS

Tim Hunter

*** Sent via Developersdex http://www.developersdex.com ***
Jan 25 '07 #1
11 10304
rkc
Tim Hunter wrote:
Hi I am using WinXP and Access 2003
Is it possible to store the field names of a table in an array and then
loop through the array and update the table using the field names stored
in the array? I can't figure out the coding to accomplish this.
I have an Excel application that is a monster and it has become too much
to maintain and test. I didn't write it but i support it. I am trying to
convert this application to Access and it is not as easy as it sounds.
Lots of field names and lots of tables. I have actually exceeded the
maximum number of field names in a table causing me to breakdown the
data and create more tables...
Come on now, creating an Access application is as simple as selecting
one of the many pre-made templates and entering or tranfering your data.
Anyone can point and click their way to success without ever having to
consult with a ridiculously highly paid database developer. Some of
them already have enough money as it is any way.

Spending some time reading up on relational database design in general
and normalization in particular might also be of some value.

To answer your question, yes it is. How would that help?
Jan 25 '07 #2
"Tim Hunter" <th*****@roches ter.rr.comwrote
Hi I am using WinXP and Access 2003
Is it possible to store the field names of a table
in an array and then loop through the array and
update the table using the field names stored
in the array?
"Yes," as rkc said, "it is."

"No," I say, "it is almost certainly not what you SHOULD be doing."

From your description, it sounds as if you are "committing spreadsheet" --
wanting to use Access as nothing but a bigger version of Excel, that can
handle more rows and columns. I agree that you need to carefully review what
business functions you need to accomplish, and how you need to structure and
use the data -- which, in a database, will not be tables with so many
columns you bump into Access' limitations.

Where I disagree with rkc (and I think he was being somewhat facetious) is
that I think you might well benefit if you contract with an experienced
Access developer to work with you and from whom you might learn. But, even
before that, check out the recommended self-study books at
http://www.mvps.org/access and other sites.

Some of my favorites are:

"Microsoft Access Step-by-Step" from Microsoft Press for the raw Access
beginner

"Microsoft Access 2003 Inside-Out" by John Viescas, from Microsoft Press, or
"Special Edition Using Microsoft Access <version>" by Roger Jennings, from
Que,
both of which start from the beginning but go farther into development than
the Step-by-Step books

"Microsoft Access <versionDevelop er's Handbook" by Litwin, Getz, et al,
from SYBEX for the intermediate to advanced developer

but there are many books available, and most of them are good -- but not if
they just sit on the shelf at the bookstore.

Larry Linson
Microsoft Access MVP


Jan 25 '07 #3
Gentleman,
I asked a simple question I didn't expect to be attacked. I have 40 plus
years in development and I have been developing in Access for about 10
years. This doesn't make me an expert by any means and I may not be at
your level, but I do know my way around in Access. Before I refuse a
paying client because something isn't politically correct, I exaust all
possibilities and that is what i am doing at this moment. There are many
ways to skin this cat and using Access and arrays is one idea I thought
might work.

Thank you

Tim Hunter

*** Sent via Developersdex http://www.developersdex.com ***
Jan 25 '07 #4


On Jan 25, 4:35 pm, Tim Hunter <thun...@roches ter.rr.comwrote :
Gentleman,
I asked a simple question I didn't expect to be attacked. I have 40 plus
years in development and I have been developing in Access for about 10
years. This doesn't make me an expert by any means and I may not be at
your level, but I do know my way around in Access. Before I refuse a
paying client because something isn't politically correct, I exaust all
possibilities and that is what i am doing at this moment. There are many
ways to skin this cat and using Access and arrays is one idea I thought
might work.

Thank you

Tim Hunter

*** Sent via Developersdexht tp://www.developersd ex.com***
Does this help?
Sub foo()
Dim ColumnNames As Variant
Dim ColumnValues As Variant
Dim i As Integer
Dim rst As DAO.Recordset

ColumnNames = Array("Column1" , "Column2", "Column3")
ColumnValues = Array("foo", "bar", "baz")

Set rst = CurrentDb.OpenR ecordset("Table 1", dbOpenDynaset)
rst.AddNew
For i = 0 To 2
rst(ColumnNames (i)).Value = ColumnValues(i)
Next
rst.Update
rst.Close
Set rst = Nothing
End Sub

Jan 25 '07 #5
Tim Hunter wrote:
>Before I refuse a
paying client because something isn't politically correct, I exaust all
possibilities and that is what i am doing at this moment.
Hi Tim,

I didn't think you weren't attacked.

But the above concerns me... are you saying that if a client requests
something that is not a good idea that you will try to do it anyway? I
would think that one of the purposes of those of us who provide our
expertise in information technology to lay folk would be to advise
against poor choices and do our best to guide them correctly....
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Jan 25 '07 #6
Ahhhh, I've been waiting for someone to ask this question and a good
question it is. Certainly I consider myself an Information Systems
Professional (Semi-Retired) and under that umbrella I want to develop
good industrial strength applications that follow good design concepts
using good coding conventions. Having said that, I also am not a person
to say that something can't be done unless I have a good understanding
of why it either can't or shouldn't. I try to keep an open mind when I
do my research and I always come away with much more knowledge than I
started with. What I end up with for the application that I am working
on now is my decision and the customer will more than likely follow my
recommendations , but I had better know what I am talking about when i
talk to him or I won't be there for long...

Respectfully

Tim Hunter

*** Sent via Developersdex http://www.developersdex.com ***
Jan 26 '07 #7
Thank you very much, this is exactly what I couldn't figure out on my
own. I tested this and it works just fine. Why I love this Web Site is
because being semi-retired I can't walk over to the next cube and ask a
question. You guys are my next cube...

Thank you ver much

Tim Hunter

*** Sent via Developersdex http://www.developersdex.com ***
Jan 26 '07 #8
rkc wrote:
Tim Hunter wrote:
Hi I am using WinXP and Access 2003
Is it possible to store the field names of a table in an array and then
loop through the array and update the table using the field names stored
in the array? I can't figure out the coding to accomplish this.
I have an Excel application that is a monster and it has become too much
to maintain and test. I didn't write it but i support it. I am trying to
convert this application to Access and it is not as easy as it sounds.
Lots of field names and lots of tables. I have actually exceeded the
maximum number of field names in a table causing me to breakdown the
data and create more tables...

Come on now, creating an Access application is as simple as selecting
one of the many pre-made templates and entering or tranfering your data.
Anyone can point and click their way to success without ever having to
consult with a ridiculously highly paid database developer. Some of
them already have enough money as it is any way.

Spending some time reading up on relational database design in general
and normalization in particular might also be of some value.

To answer your question, yes it is. How would that help?
What's happening here, rkc? Is this thread some kind of troll or test?
There's gotta be some explanation. My guess is that it's some kind of
bet between you and the original poster where he makes some posts that
are stupider than can be imagined and a few bucks are going to change
hands on the basis of the general tone of the answers.

Jan 26 '07 #9
Tim Hunter <th*****@roches ter.rr.comwrote in
news:45******** *************@n ews.qwest.net:
Thank you very much, this is exactly what I couldn't figure out on
my own. I tested this and it works just fine. Why I love this Web
Site is because being semi-retired I can't walk over to the next
cube and ask a question. You guys are my next cube...
Um, you aren't using a website. You're using a Usenet group.
AccessMonster is just a website that is a gateway to Usenet, a very
poor one, at that.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Jan 26 '07 #10

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

Similar topics

12
7722
by: jacob nikom | last post by:
Hi, I would like to store XML files in MySQL. What is the best solution: 1. Convert it to string and store it as CLOB/text 2. Serialize it and store as byte array 3. Flatten it out and create one column per element, each column is VARCHAR Does MySQL has anything special for XML data? Is there any software which helps to store XML data in MySQL
1
2636
by: Randy | last post by:
Access= 2002 I'm NOT a Programmer, but I have used VB in the past to do some things ( Spaghetti Code King) so I have some understanding of Coding I need to replace a text field (teacher) in Table (attendance) with a lookup fileld. the lookup field will point to a newly created table (teachers) the original DB was never intended to do the job that it is doing, but
8
1920
by: brian kaufmann | last post by:
Hi, I'm new to Access and this may be a basic question but I would appreciate it if you could let me know how to do this: I've created an Access table and would like to insert a column with the field name "name" and to put the same word "unknown" down all the rows of the column. How could this be done both in the design mode and in sql code?
5
2491
by: JonH | last post by:
Ok, I have this dynamically created table in my one of my php forms that shows the names of the people the user has entered into a text field. When they hit add a row displays, showing the name they entered. Also, an image that allows them to delete shows beside the name upon creation. The delete removes the name from the table and pushes the other names to the top. Simple stuff, however, if I delete the last name displayed(the bottom of...
16
3498
by: Ian Davies | last post by:
Hello Needing help with a suitable solution. I have extracted records into a table under three columns 'category', 'comment' and share (the category column also holds the index no of the record in a hidden field) I wish the user to be able to edit the data in the table, so I have extracted the records into hiddenfield, textareas, dropdown list and checkbox so that they can make changes. I named these elements as arrays and wish to run an...
5
1828
by: eric.nguyen312 | last post by:
I have an amend button which when clicked puts the Job form into edit. When saved, Access backs up old job information into 'AmendedJobBackUp' table. What I want is to add a new column 'OldJobIndex' in the 'Job' table and have all amended 'JobIndex' stored in there. How would I go in doing this?
4
22570
by: Bob | last post by:
Hi all, I've got a table that I've imported and it has junk at the top of the table, so after import I run a delete query to remove the junk lines then I'm left with the field names I want for the table at the top of the table but the field names currently are 'field1' etc, so how do I rename the field names to the fields on the top row of the table. Cheers,
4
16702
prabunewindia
by: prabunewindia | last post by:
Hello everybody, here i am going to explain, how to get mails from Outlook express database and store in our own database(local) Initially you have to add the refference Outlook library10.0 or 11.0 from add ref. If you not find that, download the dll from here and install..click here open and windows application (or ASP.NET) in Form1 class code(declare) the following,
3
158
by: Daniel | last post by:
We have a MS Access Db that is on certain pc's within our locations.. so that comes out to be around 40+ databases.. ( old software ) each of those pc's dont have MS Access loaded on them( this is a good thing ) the software uses it.. For any new stores we open we have to go into the database to hardcode the location number, once that is in place, then the rest of the configuration is handled by the software.
0
9571
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10169
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10013
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9960
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9841
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7383
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3930
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3533
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2807
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.