Re: How can i get the "true" name of an aliased field?
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Thu, 15 Nov 2007 11:57:26 -0500
ekkehard.horner wrote:
Quick and dirty example:
Dim aTests : aTests = Array( _
"SELECT FieldName AS FieldNameAlias FROM table" _
, "SELECT [FieldName] AS [FieldNameAlias] FROM table" _
, "SELECT WhatEver.FieldName AS [FieldNameAlias] FROM table" _
, "SELECT F1 AS A1, F2 AS A2 FROM table" _
, "SELECT F1 AS [AS], F2 AS A2 FROM table" _
)
Dim oRE : Set oRE = New Regexp
oRE.Pattern = "\[?(\w+(?:\.\w+)*)\]?\s+AS\s+\[?(\w+)\]?"
oRE.Global = True
oRE.IgnoreCase = True
Dim sTest, oMTS, oMT
For Each sTest In aTests
WScript.Echo "------", sTest
Set oMTS = oRE.Execute( sTest )
For Each oMT In oMTS
WScript.Echo "", oMT.SubMatches( 1 ), "==>",
oMT.SubMatches( 0 ) Next
Next
Does this handle this case:
Select ([Field1] & [Field2]) AS FieldAlias
--
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.
.
- Follow-Ups:
- Re: How can i get the "true" name of an aliased field?
- From: ekkehard.horner
- Re: How can i get the "true" name of an aliased field?
- References:
- How can i get the "true" name of an aliased field?
- From: Patrick
- Re: How can i get the "true" name of an aliased field?
- From: Bob Barrows [MVP]
- Re: How can i get the "true" name of an aliased field?
- From: ekkehard.horner
- How can i get the "true" name of an aliased field?
- Prev by Date: Re: How can i get the "true" name of an aliased field?
- Next by Date: Re: How can i get the "true" name of an aliased field?
- Previous by thread: Re: How can i get the "true" name of an aliased field?
- Next by thread: Re: How can i get the "true" name of an aliased field?
- Index(es):
Relevant Pages
|
|