Hi
I looked at the code in class JetDriver.
I found the method:
Code:
private string TransformFromClause(string fromClause)
{
string transformed;
string[] blocks = fromClause.Split(',');
if (blocks.Length > 1)
{
for (int i = 0; i < blocks.Length; i++)
{
string tr = TransformJoinBlock(blocks[i]);
if (tr.IndexOf(" join ") > -1)
{
blocks[i] = "(select * from " + tr + ") as jetJoinAlias" + i.ToString();
}
else
{
blocks[i] = tr;
}
}
transformed = string.Join(",", blocks);
}
else
{
transformed = TransformJoinBlock(blocks[0]);
}
return transformed;
}
So I made a few corrections, and it works now. Since it is possible, that correction should be made somewhere else....I am just submiting this code for you to check.
The new method should be:
Code:
private string TransformFromClause(string fromClause)
{
string transformed;
//"from ".Length
const int fromLength = 5;
fromClause = fromClause.Substring(fromLength, fromClause.Length - fromLength);
string[] blocks = fromClause.Split(',');
if (blocks.Length > 1)
{
for (int i = 0; i < blocks.Length; i++)
{
string tr = TransformJoinBlock(blocks[i]);
if (tr.IndexOf(" join ") > -1)
{
blocks[i] = "(select * from " + tr + ") as jetJoinAlias" + i.ToString();
}
else
{
blocks[i] = tr;
}
}
transformed = string.Join(",", blocks);
}
else
{
transformed = "from " + TransformJoinBlock(blocks[0]);
}
return transformed;
}
Please let me know, if you feel ok with this.
Lp
Pistotnik