473,324 Members | 2,567 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,324 software developers and data experts.

ADODB Fields Question

Hi,

I am a rookie and trying to use the ADODB recordset.
I got the hang on how ot open a table and navigate thru it.
The only question I have is that currently I am using a kind of field Index
to access a field in the table like
//
Rec1.Open("users",sCon,ADODB.CursorTypeEnum.adOpen ForwardOnly,ADODB.LockType
Enum.adLockOptimistic,0);
textBox1.Text = Rec1.Fields[1].Value.ToString()
//
Is it possible to access a field with it's name not with the index.
//
Thanks
Ivan Sammut
Nov 15 '05 #1
2 7504
Hi Ivan,

You should really switch to ADO.NET and get rid of ADO.

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com

"Ivan Sammut" <sa*****@nextgen.net.mt> wrote in message
news:eq**************@TK2MSFTNGP10.phx.gbl...
Hi,

I am a rookie and trying to use the ADODB recordset.
I got the hang on how ot open a table and navigate thru it.
The only question I have is that currently I am using a kind of field Index to access a field in the table like
//
Rec1.Open("users",sCon,ADODB.CursorTypeEnum.adOpen ForwardOnly,ADODB.LockType Enum.adLockOptimistic,0);
textBox1.Text = Rec1.Fields[1].Value.ToString()
//
Is it possible to access a field with it's name not with the index.
//
Thanks
Ivan Sammut

Nov 15 '05 #2
Ivan

Try this:
textBox1.Text = Rec1.Fields["NameOfField"].Value.ToString()
Please don't shoot me if it doesn't work, because I haven't tried it...

Although I recommend you to switch to ADO.NET.

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Ivan Sammut" <sa*****@nextgen.net.mt> schreef in bericht
news:eq**************@TK2MSFTNGP10.phx.gbl...
Hi,

I am a rookie and trying to use the ADODB recordset.
I got the hang on how ot open a table and navigate thru it.
The only question I have is that currently I am using a kind of field Index to access a field in the table like
//
Rec1.Open("users",sCon,ADODB.CursorTypeEnum.adOpen ForwardOnly,ADODB.LockType Enum.adLockOptimistic,0);
textBox1.Text = Rec1.Fields[1].Value.ToString()
//
Is it possible to access a field with it's name not with the index.
//
Thanks
Ivan Sammut

Nov 15 '05 #3

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

Similar topics

0
by: elcc1958 | last post by:
I need to support a VB6 application that will be receiving disconnected ADODB.Recordset from out DotNet solution. Our dotnet solution deals with System.Data.DataTable. I need to populate a...
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...
5
by: Simone | last post by:
Hello I hope you guys can help me. I am very new to ADO... I am creating a ADODB connection in a module and trying to access it from a command button in a form. Function fxEIDAssgn(plngEID As...
0
by: Peter Rilling | last post by:
Although an ADODB question, I am using C#, so here I go. I am trying to use the ADODB Stream object to extract content from a body part of an MHTML formatted document. I can save the raw...
3
by: Yuk Tang | last post by:
I'm trying to grab the fieldnames and values from a recordset, but I'm getting errors. I have an idea what the error might come from, but I'm not sure how to correct it. I'm connecting to an...
3
by: Karin J | last post by:
I am in the process of converting a PHP5 script that talks to an MS SQL db from using ODBC to ADODB. I should say that I have no control over what is installed on the (remote) server. It seems to...
1
by: sphinney | last post by:
All, I have a ADODB.Recordset in my Access 2002 project. I've been able to successfully add fields to the record set. According the the MS Access help files, I now must update the recordset to...
10
by: chuckzter | last post by:
Hey guys, I would like to know how to replace values in your database via ADODB. Example: (I would want to replace the value LOCATION of ID 1001 which is Oliver to Laguna.) ID NAME...
6
by: Oko | last post by:
I'm currently developing an MS Access Data Project (.adp) in MS Access 2002. One of the reports within the DB uses data that is Dynamic and cannot be stored on the SQL Server. To resolve this, I...
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
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.