Habe ein vielleicht altbekanntes Problem mit dem SQl Union Befehl.
In einem Basic Sub scheint das irgendwie nicht zu funktionieren.
Kann mir jemand Helfen?
Ich möchte untenstehendes SUB (ImportRowSet) verwenden.
src ist dabei in etwa folgendes:
Code: Alles auswählen
"SELECT ""Product 1"", ""Product 1 Exemplars"", ""Product 1 Pritsch"", ""Quint"", ""Pajà"" FROM ""Empustaziuns_Debiturs_R-tunes"" WHERE ""Product 1"" LIKE '" + sArtist + "%' UNION SELECT ""Product 2"", ""Product 2 Exemplars"", etc
Code: Alles auswählen
Sub importRowSet( oDBRange, dbSourceName$, srcType%, src$ )
Dim oDesc(),i%,oPrp
'on error goto exitErr:
oDesc() = oDBRange.getImportDescriptor() 'array of com.sun.star.beans.PropertyValues
For i = 0 to ubound(oDesc())
oPrp = oDesc(i)
If oPrp.Name = "DatabaseName" then
oPrp.Value = dbSourceName
elseIf oPrp.Name = "SourceType" then
oPrp.Value = srcType
elseIf oPrp.Name = "SourceObject" then
oPrp.Value = src
Endif
oDesc(i) = oPrp
Next
oDBRange.getReferredCells.doImport(oDesc())
exit sub
exitErr:
'raise API-error
error err
End Sub