ADODB Fields Question

I

Ivan Sammut

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.adOpenForwardOnly,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
 
J

Jan Tielens

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top