I'm converting some code that works under MS SQL using ADO & VB. I open a
recordset using statements similar to this:
strQry = "SELECT A.Fld1, B.Fld2, C.Fld3 FROM (A LEFT JOIN B ON A.A_ID =
B.B_ID) LEFT JOIN C ON A.A_ID = C.C_ID where A.A_ID = 8329 Order by A.A_ID"
rs.Open strQry, Cn, adOpenStatic, adLockOptimistic

When I copy this query into SQL Studio to debug it I get an error: "missing
keyword: SELECT".
Why is this?

 I found that if I get rid of the two parenthesis "(" and ")" in the JOIN
that I no longer get the error and the query works.
So I guess you can't have parenthesis in JOIN statements. Is this correct?

So now the code looks something like this:
strQry = "SELECT A.Fld1, B.Fld2, C.Fld3  FROM A LEFT JOIN B ON A.A_ID =
B.B_ID LEFT JOIN C ON A.A_ID = C.C_ID where A.A_ID = 8329 Order by A.A_ID"
rs.Open strQry, Cn, adOpenStatic, adLockOptimistic

But now I get a general error "updates to this table is not allowed".
Why is this? and what would you suggest I do about it?

Any answers you can give me to these four questions will be appreciated as
this sort of thing goes on throughout this system I'm converting. I've tried
sussing out the answer via the Reference Manual but it's a bit cryptic to me
on this issue. If the answer is already addressed less cryptically somewhere
on the SAPDB site and you can point me in the right direction that'd be good
too.

Thanks,
Jon



_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to