473,399 Members | 2,146 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.

Selecting value of a single field

132 100+
Hello everybody,

I've got a little question about retrieving content from a database.

I have a table which has 4 columns: ID, NLText, FRText and ENText.

The basic idea is that the user can choose the language that he preferres and I just fill in the text in the chosen language upon loading the page.

In my code I tell him to select the appropriate columnname to be retrieved in the recordset.

When I try to fill in the content in the page I actually want to use the indexes value of the recordset. And that's where it goes wrong.

To make it all a bit more clear, here's a snippet of the code:

Expand|Select|Wrap|Line Numbers
  1.  
  2. langSQL = "SELECT ENText FROM Language"
  3. Set lang = DBConnection.Execute(langSQL)
  4. ...
  5.  
  6. <% =lang.fields.item(2) %>
  7.  
In my column in my database I have 6 rows with text.
I was hoping to be able to read the text directly out of the recordset but I'm not sure if this is possible although I couldn't imagine it not being possible.

Who can point me in the right direction?

*** Edit ***
It just hit me that the fields aren't going to work obviously since these are the fields of the records.

What I would need is a way to select the different records of the recordset.

One way of doing this would be to loop through the Recordset and put all values into an array and then read from the array but I'm hoping that there will be an easier way of doing this.


Thanks,
Kenneth
May 9 '12 #1
2 1753
Cainnech
132 100+
Another update:

I realised that I had actually created my database in the wrong way.
I had 3 columns for the different languages and then a number of rows with the content in it.

Right now I changed it so that I have 3 rows with the languages and the content into different columns which makes it much more easy to handle because all of the content of a single language is now stores in a single recordset.

So my problem is solved, however if anybody knows if it is possible to select a single value out of a recordset with multiple rows without looping through it, then please do share.

Thanks,
Kenneth
May 9 '12 #2
Rabbit
12,516 Expert Mod 8TB
Recordsets have a Move method that will move the location of the cursor a specified number or records. Although, you would be better off just using the WHERE clause of a query to filter down to the one row you need instead of returning everything and then moving to the row you need.
May 9 '12 #3

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

Similar topics

2
by: John | last post by:
Hello, I have a table called BUILDREQUESTS which I want to select from, depending on the project ID of each record. The Project ID field is indexed. (A) This query runs almost instantly: ...
2
by: Jen F. | last post by:
I have inherited a medical database in which there are multiple values stored in a single field (ie. "Current Conditions" field might contain 1-20 different conditions, separated by comma (ie....
3
by: klawiter | last post by:
Greetings, I have a table with two columns. On my form, I have a combo field that displays the contents of the first column. Upon selecting an item in this combo field, I would like to then...
3
by: Tarrant | last post by:
Hello, I am having amazing difficulties in getting SQL to search for a single word in a text field. I have tried using PATINDEX and LIKE statements but they don't work, sure they 'work', but not in...
7
by: SHPsalm139 | last post by:
I'm working on a school application. I have a form where the user selects the marking period (1, 2, 3 or 4). That ties in to the "marking_period" field in a table. If the user indicates, for...
5
by: vandanavai | last post by:
Hello, I have problem in setting default value of field. What I want to do is as follows. I have 'Table' with fields 'PurchaseDate' and 'CapitalisationDate'. I want to set dafault value of field...
5
by: antony123 | last post by:
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 .
3
by: Bjorn Sagbakken | last post by:
What is the best way to read single field values from a dataset? The dataset is populated with a customer record, showing well in a gridview. But I also want to read the single field values, like...
1
by: nathanwb | last post by:
I have a small app that allows users to send messages back and forth to each other. I have a place that shows there messages and they can click on a message to read. I have a field in the table...
1
by: GRUNT | last post by:
As a beginer,Im trying to COUNT values in a single field where they meet the critria below., Then SUM then altogether. Coursename,enddate1 and enddate2 are Request.QueryStrings form an .ASP web...
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
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,...
0
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...
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,...
0
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...

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.