Re: field alias when running SQL on *** ranges
- From: "RB Smissaert" <bartsmissaert@xxxxxxxxxxxxxxxx>
- Date: Sat, 19 Nov 2005 18:21:01 -0000
Thanks Bob, that is the one I forgot about. Works nicely even with Interbase.
RBS
"Bob Phillips" <bob.phillips@xxxxxxxxxxxxxxxxxxxx> wrote in message news:eTbjBST7FHA.476@xxxxxxxxxxxxxxxxxxxxxxx
Oky, I understand.
Use the As operator
SELECT E.TERM_TEXT AS FIELDALIAS FROM ENTRY E WHERE E.READ_CODE = 'G25..'
--
HTH
RP (remove nothere from the email address if mailing direct)
"RB Smissaert" <bartsmissaert@xxxxxxxxxxxxxxxx> wrote in message news:uOyIp$S7FHA.1944@xxxxxxxxxxxxxxxxxxxxxxxtheWhat I mean is this: In normal SQL you can do:
SELECT E.TERM_TEXT FIELDALIAS FROM ENTRY E WHERE E.READ_CODE = 'G25..'
This means you will get FIELDALIAS in your output header, rather than TERM_TEXT.
How would you do the same in range SQL? You could of course loop through the fields in the recordset and replacefields names in the *** output, but it would be easier if you could doithasin SQL.
RBS
"Bob Phillips" <bob.phillips@xxxxxxxxxxxxxxxxxxxx> wrote in message news:uP5ckxS7FHA.2888@xxxxxxxxxxxxxxxxxxxxxxx > To what the header fields? Do you mean see them? If so, the recordset> athe
> Fields collection property that you can iterate through.
>
> On the second point, you are correct, it has to be saved.
>
> -- >
> HTH
>
> RP
> (remove nothere from the email address if mailing direct)
>
>
> "RB Smissaert" <bartsmissaert@xxxxxxxxxxxxxxxx> wrote in message
> news:uqRoAOS7FHA.636@xxxxxxxxxxxxxxxxxxxxxxx
>> Is it possible to the header fields when running SQL on *** ranges?
>> The connection is like this:
>>
>> strSheetConn = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
>> "Data Source=" & ActiveWorkbook.FullName & ";" & _
>> "Extended Properties=Excel 8.0;"
>>
>> Set rs = New ADODB.Recordset
>>
>> rs.Open Source:=strQuery, _
>> ActiveConnection:=strSheetConn, _
>> CursorType:=adOpenForwardOnly, _
>> LockType:=adLockReadOnly, _
>> Options:=adCmdText
>>
>> Tried all sorts of constructions, but nil worked sofar.
>>
>> Also, would it be possible to run SQL on *** ranges without saving>> workbook first?
>> I suppose not as SQL always runs on disk (files) structures rather >> than
> data
>> in memory.
>>
>> RBS
>>
>
>
.
- References:
- field alias when running SQL on *** ranges
- From: RB Smissaert
- Re: field alias when running SQL on *** ranges
- From: Bob Phillips
- Re: field alias when running SQL on *** ranges
- From: RB Smissaert
- Re: field alias when running SQL on *** ranges
- From: Bob Phillips
- field alias when running SQL on *** ranges
- Prev by Date: Change top line data and remove lower lies
- Next by Date: Re: How to add up time
- Previous by thread: Re: field alias when running SQL on *** ranges
- Next by thread: RE: Path/File access error (Error 75) using Name Statement
- Index(es):
Loading