by mhendu » Sun Feb 10, 2019 11:42 am
Would love to know how to do this for this and future scripts, but for now I came up with what I think is a workable solution:
Dim ArtistNameTemp
ArtistNameTemp = itm.ArtistName
ArtistNameTemp = Replace(ArtistNameTemp,"'","''")
SQL = "SELECT Genre, Count(Genre) AS SortField FROM Songs WHERE Artist = '" & ArtistNameTemp & "' AND Genre <> '' GROUP BY Genre ORDER BY SortField DESC"
If I'm reading correctly this should escape out the single quotes - appears to work correctly in my script now, but there may be other special characters that I'm not accounting for.
Would love to know how to do this for this and future scripts, but for now I came up with what I think is a workable solution:
Dim ArtistNameTemp
ArtistNameTemp = itm.ArtistName
ArtistNameTemp = Replace(ArtistNameTemp,"'","''")
SQL = "SELECT Genre, Count(Genre) AS SortField FROM Songs WHERE Artist = '" & ArtistNameTemp & "' AND Genre <> '' GROUP BY Genre ORDER BY SortField DESC"
If I'm reading correctly this should escape out the single quotes - appears to work correctly in my script now, but there may be other special characters that I'm not accounting for.