473,327 Members | 1,896 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,327 software developers and data experts.

Problem of geting the value of field in Recordset object with index vlaue

Hai All hard coders ,
Tell me how to get the value of field in a record in a recordset onject in visual basic using is index rather than the field name.Please help me .
Aug 31 '07 #1
5 1500
debasisdas
8,127 Expert 4TB
as you are saying yourself use the index. What is the problem ?

iht index should start ffrom 0 (zero).

Expand|Select|Wrap|Line Numbers
  1. text1.text=iif(isnull(rs(0)),"",rs(0))
Aug 31 '07 #2
The actual code is this
But it does not work.
content = rsIndividual13.Fields.Item(1) & "---" & rsIndividual13.Fields.Item(2) & "---" & rsIndividual1!DateOfMarriage _
& "---" & rsIndividual13.Fields.Item(3) & "---" & rsIndividual13.Fields.Item(4) & "---" _
& "---" & rsIndividual13.Fields.Item(5) & "---" & rsIndividual13.Fields.Item(6) & "---" _
& "---" & rsIndividual13.Fields.Item(7) & "---" & rsIndividual13.Fields.Item(8)
Aug 31 '07 #3
debasisdas
8,127 Expert 4TB
you are using vb 6.0 or advance version ?
Aug 31 '07 #4
debasisdas
8,127 Expert 4TB
for vb6.0 try like the following sample code

Expand|Select|Wrap|Line Numbers
  1. content = rsIndividual13(1) & "---" & rsIndividual13(2) & "---" & rsIndividual13(3) & "---" & rsIndividual13(4) & "---" & rsIndividual13(5) 
Aug 31 '07 #5
QVeen72
1,445 Expert 1GB
Hi,

u can also give this :

Expand|Select|Wrap|Line Numbers
  1. txtName = rs("EName") & ""
  2.  
  3. Or 
  4.  
  5. txtName = rs.Fields("Name") & ""
  6.  
  7. Or
  8. txtName = rs(0) & ""
  9.  
  10. Or
  11. txtName =rs.Fields(0).Name
  12.  
  13.  
REgards
Veena
Aug 31 '07 #6

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

Similar topics

9
by: Kathryn | last post by:
Hiya I have a problem with using some client side and server side scripting together in an ASP. I'm using VBScript. What I'm trying to achieve is this - - Page loads up and some server side...
20
by: | last post by:
If I need to check if a certain value does exist in a field, and return either "yes" or "not" which query would be the most effestive?
0
by: Channing Jones | last post by:
Hello everyone, I am trying to store data in a binary field of an SQL-Server table using ADODB. So far, I have managed to store a record but not any data in the binary field. I only get...
11
by: Tony Williams | last post by:
I have a module called GetDocIndex which calculates a sequential number in a control called CommDocNbrtxt. On the BeforeUpdate property of the form I have the following code Private Sub...
2
by: Joseph Markovich | last post by:
I'm having some trouble with VB in Access 2000. I have a form that the user enters in just one number (in this case, it's a base salary) and then the program is going to do a bunch of math (which...
3
by: RBohannon | last post by:
I'm using Access 2000. I've written a function, blnExists(), to check if a particular value exists in the primary key field of a table. blnExists returns true if the value is in the table and...
8
by: Dave Hagerich | last post by:
I'm using a DataGrid with a DataSet and I'm trying to filter the data being displayed, using the following code as a test: DataView theView = new DataView(theDataSet.Tables); theView.RowFilter =...
9
by: zMisc | last post by:
When I try to update record, I kept getting this error: Row cannot be located for updating. Some values may have been changed since it was last read. No other users are accessing the database...
1
by: zoeb | last post by:
Currently I have a table, and would like the calculate a field in the table by referencing values from another 3 tables. i.e. tblData Index1, Index2, Index3, Value 1 2 3 2...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.