Re: name of field is in variable: how to use in SQL?
From: Burt (burtspam_at_me.us)
Date: 08/04/04
- Next message: Aaron [SQL Server MVP]: "Re: Sql Server and VBScript decimal problem"
- Previous message: Chris Kennedy: "Sql Server and VBScript decimal problem"
- In reply to: Bob Barrows [MVP]: "Re: name of field is in variable: how to use in SQL?"
- Next in thread: Bob Lehmann: "Re: name of field is in variable: how to use in SQL?"
- Reply: Bob Lehmann: "Re: name of field is in variable: how to use in SQL?"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 4 Aug 2004 15:25:00 +0200
I appreciate your work, really, but you are not my teacher and i'm not your
student. Sometimes one needs a urgent answer and sometimes, there is no time
for experimentation.
Thanks anyway
B
"Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message
news:%23jR02DieEHA.3916@TK2MSFTNGP11.phx.gbl...
> Burt wrote:
> > Sorry, in fact this works, but i can't recover the field values:
> >
> > a="maandag"
> > set objdc = Server.CreateObject("ADODB.Connection")
> > objdc.Open("provider=Microsoft.Jet.OLEDB.4.0; Data Source
> > =d:\access\newres.mdb")
> > sql="select '" & a & "' from daguur;"
>
> You're not getting my point. Show us the result from "response.write sql"
>
> > set rs=Server.CreateObject("ADODB.recordset")
> > rs.open sql, objdc, 3, 3
> > response.write(rs.RecordCount) ' this works
>
> Of course this works. You are getting records back. You're just not
getting
> records containing a field named maandag. Do this to see what you are
> getting:
>
> for each fld in rs.Fields
> response.write fld.OrdinalPosition & ". " & fld.name & ": " & _
> fld.value & "<BR>"
> next
>
>
> Did you try my suggestion of response.writing the sql variable and copying
> te result into the Access Query Builder to see what the sql statement you
> built returned? Obviously not. I dislike hand-holding, but just to bring
> this thread to an end, change your statement to:
>
> sql="select [" & a & "] from daguur;"
>
> I'm out of here.
>
> Bob Barrows
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>
- Next message: Aaron [SQL Server MVP]: "Re: Sql Server and VBScript decimal problem"
- Previous message: Chris Kennedy: "Sql Server and VBScript decimal problem"
- In reply to: Bob Barrows [MVP]: "Re: name of field is in variable: how to use in SQL?"
- Next in thread: Bob Lehmann: "Re: name of field is in variable: how to use in SQL?"
- Reply: Bob Lehmann: "Re: name of field is in variable: how to use in SQL?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|