473,693 Members | 2,766 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Selecting single row from access table

40 New Member
Hello,

I have an access table with fields: ID, Name, Surname, Training. I would like to select every single row in this table to operate on it. Alghoritm would look something like that:
i = 1 to all_rows
1. Select i row
2. Check if ID exists in EMPLOYEES table
3. Read ID, Name and Surname and insert it in table EMPLOYEES
4. Read ID and Training and insert it in table PAST_TRAINIGS
5. Return to 1

How can I do that in Visual Basic code? The problem is in selecting every each row and columns in this row.

Cheers!
Sep 10 '07 #1
3 8890
damonreid
114 Recognized Expert New Member
Search for "Update Query" in the help file, will give you everything you need.
Sep 10 '07 #2
saddist
40 New Member
You are missing the point here. I don't want to have an update query. I wrote I want it to be done via VBA code and I have my reasons. Plus I want it done just as in algorithm I wrote in first post.
Sep 10 '07 #3
barry07
47 New Member
Use the ADO recordset. The syntax is something like this

Expand|Select|Wrap|Line Numbers
  1. Function CycleThroughRecords
  2. Dim dbs as Database
  3. Dim rs as Recordset
  4. set dbs=CurrentDB
  5. set rs=dbs.openRecordset("SELECT  whatever from [table] where...")
  6. rs.movefirst
  7. while not rs.EOF
  8.        .<manipulte records>
  9.         rs.movenext
  10. wend
  11. set rs=nothing
  12. set dbs=nothing
  13. End Function
This should be enough to get you started. The RecordSet object allows very granular access to the data, but yiu can read about that yourself
Sep 10 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1426
by: hristov.milen | last post by:
Hi, Is there a way to restrict selecting from a table.. I have problem with one check, I have select and after this insert based on the select. If it happen in one time .. I can insert incorrect information. If I do lock table SOMETABLE read; it still select and return results normaly. I'm open for suggestions :)
3
4310
by: Phil Rutter | last post by:
Hello All, I have about 700 word documents that have 2 tables one is static 4 colums x 5 rows the other is 5 colums x rows ranging from 2 to 100 what i wolud like to do is open the word doc. import the first word table then import the second word table close word doc open next word doc and repeat process. i am able to import one set of data currently into an excel spread sheet but how can i loop through all the documents and import them...
5
4348
by: premmehrotra | last post by:
I am using Microsoft Access 2000 and Oracle 9.2.0.5 on Windows 2000. When I export a table from Access to Oracle using ODBC I get error: ORA 972 identifier too long I think the error is because one or more columns in Access table are longer than 30 characters. My question is how one can overcome this problem. I also see several column names which have /, ? or spaces in name
1
4473
by: Pierre Maricq | last post by:
Hi, I am using Win2000 and Access2000. I need to build build a macro or write a VBA in Access that would screen all files contained in a directory on my C drive (files are structrured DAT files ) and update an Access table with the following information: (1) Filename (variable lenght) (2) Modified File Date/Time
3
10320
by: equalive | last post by:
Hi guys, I'm having problem locking a table in Ms Access using VB6 code. Actually I have 3 tables. Assume table names is A, B, C. Following is the process. 1. Open table A and update table A. (Must Lock the table A) 2. Open table B and update table B.
11
5382
by: MD | last post by:
Hello, I need to import a sheet of 884 different excel-file with same lay- out. The sheet name is 'Totaal' and is the same in all different files. Is there a script (module) in order to: 1. create a table with all the different names of the 884 files 2. create the import queryfor the 884 different files, but also mentioning the file name of the excel-file in a colomn
5
1538
by: Priya ramanan | last post by:
Hi Everyone, I am trying to insert a row into MS-Access table. The table contains the details of error (number and description) occured in the whole script. The query written for inserting a row is as follows. strQuery = "Insert into ErrorLog values('& Err.Number & ",' " & Err.Description & " ')" The problem is the Error description is like "The directory doesn't exists", in which a single quote is present (doesn't). Because of that the...
0
955
by: SDEIT | last post by:
Hi , I am having a folder containing diff excel files with same pattern of data (diff rows and same columns with column header). I want to put all the datas in to a single oracle table so that using select query I can fetch datas as I like. How to upload all excel files into single table, Can u pl give some vb script to compile... My sincere thanks in advance for solving the issue.
0
1570
by: Bruce Harmon | last post by:
I would like to know how to populate Treeview from a single Access table named Shipdata so that I get a treeview that looks like the attached picture. The project I am working on is in VB.net 2008 The fields I would like make into nodes are as follows: Race Base_Hull Designation Any help would be apprecated.
0
8616
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
8552
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9107
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
8971
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...
0
8812
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...
0
5825
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2992
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
2248
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1970
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.