473,569 Members | 2,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Statements working with ADO data control and results

10 New Member
Been working on some programming exercises in my spare time and don't fully understand this one related to ADO....Apprecia te any help on this.

The name of the ADO data control is adoNum-----Was trying to figure which one of these statements would multiply the contents of the fldNum1 field by 3 and then store the result in the fldTot field?



adoNum.Fields(f ldTot) = adoNum.Fields(f ldNum1) * 3

adoNum.Fields(" fldTot") = adoNum.Fields(" fldNum1") * 3

adoNum.Recordse t.Fields(fldTot ) = adoNum.Recordse t.Fields(fldNum 1) * 3

adoNum.Recordse t.Fields("fldTo t") = adoNum.Recordse t.Fields("fldNu m1") * 3
Apr 1 '08 #1
1 1326
jeffstl
432 Recognized Expert Contributor
Been working on some programming exercises in my spare time and don't fully understand this one related to ADO....Apprecia te any help on this.

The name of the ADO data control is adoNum-----Was trying to figure which one of these statements would multiply the contents of the fldNum1 field by 3 and then store the result in the fldTot field?



adoNum.Fields(f ldTot) = adoNum.Fields(f ldNum1) * 3

adoNum.Fields(" fldTot") = adoNum.Fields(" fldNum1") * 3

adoNum.Recordse t.Fields(fldTot ) = adoNum.Recordse t.Fields(fldNum 1) * 3

adoNum.Recordse t.Fields("fldTo t") = adoNum.Recordse t.Fields("fldNu m1") * 3
OK, Im not quite sure what your adoNum is defined as. I assume it is a recordset though the way you have it displayed here.

That being the case this line would be your best bet I suppose

adoNum.Fields(" fldTot") = adoNum.Fields(" fldNum1") * 3

Though I would recommend setting your entire recordset into variables before manipulating, especially if the data types are not set in the tables to integers
Expand|Select|Wrap|Line Numbers
  1. dim TotalNum as Integer
  2. dim FieldNum as Integer
  3. FieldNum = adoNum.Fields("fldNum1") 
  4. TotalNum = FieldNum * 3
  5. adoNum.Fields("fldTot") = TotalNum
  6. adoNum.Update
  7.  
However, you have to still perform an update on your recordset once your field values are set, assuming you are "on" the right record in your code.

Expand|Select|Wrap|Line Numbers
  1. adoNum.Update
  2.  
Apr 2 '08 #2

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

Similar topics

11
97177
by: dmbkiwi | last post by:
I am new to this group, and relatively new to python programming, however, have encountered a problem I just cannot solve through reading the documentation, and searching this group on google. I have written a theme in python for the superkaramba theme engine on kde (see http://netdragon.sourceforge.net - if you are a kde/linux user, it is...
1
3801
by: Tom D | last post by:
I'm rewriting a database interface that our company currently has. Currently it's using the Pear::DB interface, but we found that that was introducing a bit too much overhead. I'm rewriting the interface to use mysqli. Most of what the interface does is to simplify getting results in the form of arrays (ordered and associative). Most of the...
4
16744
by: DG | last post by:
Hi, Can anyone advise how to execute multiple statements in a single query batch. For example- update customers set customer_name = 'Smith' where customer_name = 'Smyth'; select * from customers; I can execute each statement individually but get the 'you have an error in
2
2227
by: misschristalee | last post by:
I'm having a brain blockage day.... Scenario: Search Form with 6 text boxes Query has same six fields Each has this IIF: IIf(IsNull(!!),"",!!) with each dictating the correct text box of course. SQL dictates... If text box 1 isNull do nothing or do this OR if text
0
2769
by: Wesman | last post by:
Why does the following code not work (displays the correct values in the second textbox). if i chane the OnFocusChange method to the following it will work: private void OnFocusChange(object sender, System.ComponentModel.CancelEventArgs e) { Control control = (Control) sender; control.BindingContext.EndCurrentEdit(); results.Text =...
34
10788
by: Jeff | last post by:
For years I have been using VBA extensively for updating data to tables after processing. By this I mean if I had to do some intensive processing that resulted in data in temp tables, I would have VBA code that wrote the results of that away to the db, either creating new records or updating existing records, whichever was relevant. This may...
2
2724
by: ojorus | last post by:
Hi! Some questions regarding the mysqli-extension (php5) 1) Prepared statements: If I understand things right, prepared statements will give better performance if you make several similar querys. (where you only change the parameters) But what if you do only ONE query; will it then be usefull to use prepared statements? Can it actuelly give...
12
1874
by: Jerim79 | last post by:
I have created a verification script to verify information and redirect the customer to the appropriate error page. For example: if ($FName=""){ header('Location:/verify_fname.htm'); } else{ if ($LName=""){ header('Location:/verify_lname.htm'); }
8
2937
by: =?Utf-8?B?UGFvbG8=?= | last post by:
Is there any way I can avoid the ugly and repetitive 'if' construct shown below? I can't refactor into a separate method because qryTrans is an anonymous type. I don't think I can use a switch statement either. It works fine but is not aesthetically pleasing! private void btnSearch_Click(object sender, EventArgs e)
0
7612
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...
0
7924
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. ...
0
8120
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...
1
7672
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...
0
6283
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2113
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
1
1212
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
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...

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.