Hello,
I have written following query in Vb
dim str11 as string
str11="select case a.Company_id when 0 then '' Else: a.Comp_name end , case b.Desig_id when 0 then '' Else: b.Desig_name end , case c.Industry_id when 0 then '' Else: c.Ind_name end , case d.Function_id when 0 then '' Else: d.Function_name end from Company_Mst a,Designation_Mst b,Industry_Mst c, Function_Mst d Where a.Company_id = " & rs4.Fields("Company_id") & " And b.Desig_id =" & rs4.Fields("Desig_id") & " And c.Industry_id =" & rs4.Fields("Indusrty_id") & " And d.Function_id =" & rs4.Fields("Function_id")
after this i ve written
set rs2=con.execute(str11)
but it is giving me error at str11 where i am assigning query to string str11
as "Item can not found in collection corresponding to requested name or ordinal "
still i ve not executed the query.
i ve written following to check query contents
msgbox(str11="select case a.Company_id when 0 then '' Else: a.Comp_name end , case b.Desig_id when 0 then '' Else: b.Desig_name end , case c.Industry_id when 0 then '' Else: c.Ind_name end , case d.Function_id when 0 then '' Else: d.Function_name end from Company_Mst a,Designation_Mst b,Industry_Mst c, Function_Mst d Where a.Company_id = " & rs4.Fields("Company_id") & " And b.Desig_id =" & rs4.Fields("Desig_id") & " And c.Industry_id =" & rs4.Fields("Indusrty_id") & " And d.Function_id =" & rs4.Fields("Function_id"))
then also it is giving me same error.
can any body tell me what is the problem & it's solution. If i run this query at
sql server it is working fine.
please help me.
Edit/Delete Message
I have written following query in Vb
dim str11 as string
str11="select case a.Company_id when 0 then '' Else: a.Comp_name end , case b.Desig_id when 0 then '' Else: b.Desig_name end , case c.Industry_id when 0 then '' Else: c.Ind_name end , case d.Function_id when 0 then '' Else: d.Function_name end from Company_Mst a,Designation_Mst b,Industry_Mst c, Function_Mst d Where a.Company_id = " & rs4.Fields("Company_id") & " And b.Desig_id =" & rs4.Fields("Desig_id") & " And c.Industry_id =" & rs4.Fields("Indusrty_id") & " And d.Function_id =" & rs4.Fields("Function_id")
after this i ve written
set rs2=con.execute(str11)
but it is giving me error at str11 where i am assigning query to string str11
as "Item can not found in collection corresponding to requested name or ordinal "
still i ve not executed the query.
i ve written following to check query contents
msgbox(str11="select case a.Company_id when 0 then '' Else: a.Comp_name end , case b.Desig_id when 0 then '' Else: b.Desig_name end , case c.Industry_id when 0 then '' Else: c.Ind_name end , case d.Function_id when 0 then '' Else: d.Function_name end from Company_Mst a,Designation_Mst b,Industry_Mst c, Function_Mst d Where a.Company_id = " & rs4.Fields("Company_id") & " And b.Desig_id =" & rs4.Fields("Desig_id") & " And c.Industry_id =" & rs4.Fields("Indusrty_id") & " And d.Function_id =" & rs4.Fields("Function_id"))
then also it is giving me same error.
can any body tell me what is the problem & it's solution. If i run this query at
sql server it is working fine.
please help me.
Edit/Delete Message