Re: Accessing field by name
From: Serge Myrand (info_at_softdelirium.qc.ca)
Date: 07/14/04
- Next message: arun prabhu: "RE: Timeout and database non operational"
- Previous message: William \(Bill\) Vaughn: "Re: Handle double quote in VB for MS Access"
- In reply to: William \(Bill\) Vaughn: "Re: Accessing field by name"
- Next in thread: Serge Myrand: "Re: Accessing field by name"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 14 Jul 2004 15:07:19 -0300
I still get an error msg. except when i use the field index!
thank's
"William (Bill) Vaughn" wrote:
> Nope. Field names are available
> rs.Fields("Fred")
> works fine.
>
> --
> ____________________________________
> William (Bill) Vaughn
> Author, Mentor, Consultant
> Microsoft MVP
> www.betav.com
> Please reply only to the newsgroup so that others can benefit.
> This posting is provided "AS IS" with no warranties, and confers no rights.
> __________________________________
>
> "Serge Myrand" <info@softdelirium.qc.ca> wrote in message
> news:40F5291B.413CBB4A@softdelirium.qc.ca...
> > Hi,
> >
> > Ok, It seems that the field names are not available on client side, am'I
> correct?
> > After spending few hours I awake and did:
> >
> > n = 0
> > for each F in R.Fields
> > if F.Name = sNo then
> > nsNo = n
> > end if
> > if F.Name = sRev then
> > nsRev = n
> > end if
> > n = n + 1
> > next
> >
> > and then I use
> > R.Fields(nsNo).Value
> >
> > thank you for your time
> > serge
> >
> >
> >
> > Serge Myrand wrote:
> >
> > > Hi,
> > >
> > > As William said, the recorset was empty at the first pass in the sub.
> Now it's
> > > Ok. Yes I did check the field name and no there is no space in the
> field
> > > name. I use sNo in 'for each xNo in Request.Form(sNo)' with succes, it
> > > contains the right field name. I am having this problem in an ASP page
> as you
> > > can see, I am asking to myself if there is not a missing (no
> initialized..)
> > > object somewhere! or field names are not available...
> > >
> > > this is an example of the test i did
> > >
> > > R.MoveFirst
> > > while not R.eof
> > > R.Properties(sNo) = "" (test False)
> > >
> > > Response.Write R.Properties(sNo) (write nothing)
> > >
> > > sTest = R.Properties(sNo)
> > > Response.Write sTest (write nothing)
> > >
> > > (R.Properties(sNo) = sProdNo) and (R.Properties(sRev) = sRevNo) (test
> True
> > > for every record)
> > > R.MoveNext
> > > wend
> > >
> > > thank's
> > > serge
> > >
> > > Val Mazur wrote:
> > >
> > > > Hi Serge,
> > > >
> > > > There is no magic. Did you check if field really exists in a
> collection of
> > > > the recordset fields? Could be misspelling, which usually is not
> obvious.
> > > > Any spaces in a field name?
> > > >
> > > > --
> > > > Val Mazur
> > > > Microsoft MVP
> > > >
> > > > "Serge Myrand" <info@softdelirium.qc.ca> wrote in message
> > > > news:40F4205B.C961380B@softdelirium.qc.ca...
> > > > > Hi,
> > > > >
> > > > > I try to access a recordset field by it's name and I get an error
> saying
> > > > > that it cannot be found in the collection. The code is as follow.
> What's
> > > > > wrong?
> > > > >
> > > > > R.MoveFirst
> > > > > while not R.eof
> > > > > if (R.Properties(sNo) = sProdNo) and (R.Properties(sRev)
> =
> > > > sRevNo) then
> > > > > DoSomething
> > > > > end if
> > > > > R.MoveNext
> > > > > wend
> > > > >
> > > > > thank's
> > > > > serge
> > > > >
> >
- Next message: arun prabhu: "RE: Timeout and database non operational"
- Previous message: William \(Bill\) Vaughn: "Re: Handle double quote in VB for MS Access"
- In reply to: William \(Bill\) Vaughn: "Re: Accessing field by name"
- Next in thread: Serge Myrand: "Re: Accessing field by name"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|