thank you.my problem has solved.but now there is some thing that doesn't work correctly i wanted to know can we have such recordset or no:
<%
Dim rs
Dim rs_numRows
Set rs = Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = MM_QCcon_STRING
if (rs__MMColParam<>"null") and (rs__MMColParam1<>"null") and (rs__MMColParam2<>"") then
rs.Source = "SELECT * FROM dbo.tbHGInf WHERE SiteWorkshop = '" + Replace(rs_MMColParam, "'", "''") + "' AND UnitNo = '" + Replace(rs_MMColParam1, "'", "''") + "' AND HGNo = '" + Replace(rs_MMColParam2, "'", "''") + "' "
end if
if (rs__MMColParam="null") and (rs__MMColParam1<>"null") and (rs__MMColParam2<>"") then
rs.Source = "SELECT * FROM dbo.tbHGInf WHERE UnitNo = '" + Replace(rs_MMColParam1, "'", "''") + "' AND HGNo = '" + Replace(rs_MMColParam2, "'", "''") + "' "
end if
if (rs__MMColParam<>"null") and (rs__MMColParam1="null") and (rs__MMColParam2<>"") then
rs.Source = "SELECT * FROM dbo.tbHGInf WHERE SiteWorkshop = '" + Replace(rs_MMColParam, "'", "''") + "' AND HGNo = '" + Replace(rs_MMColParam2, "'", "''") + "' "
end if
if (rs__MMColParam<>"null") and (rs__MMColParam1<>"null") and (rs__MMColParam2="") then
rs.Source = "SELECT * FROM dbo.tbHGInf WHERE SiteWorkshop = '" + Replace(rs_MMColParam, "'", "''") + "' AND UnitNo = '" + Replace(rs_MMColParam1, "'", "''") + "' "
end if
if (rs__MMColParam="null") and (rs__MMColParam1="null") and (rs__MMColParam2<>"") then
rs.Source = "SELECT * FROM dbo.tbHGInf WHERE HGNo = '" + Replace(rs_MMColParam2, "'", "''") + "'"
end if
if (rs__MMColParam="null") and (rs__MMColParam1<>"null") and (rs__MMColParam2="") then
rs.Source = "SELECT * FROM dbo.tbHGInf WHERE UnitNo = '" + Replace(rs_MMColParam1, "'", "''") + "' "
end if
if (rs__MMColParam<>"null") and (rs__MMColParam1="null") and (rs__MMColParam2="") then
rs.Source = "SELECT * FROM dbo.tbHGInf WHERE SiteWorkshop = '" + Replace(rs_MMColParam, "'", "''") + "' "
end if
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 1
rs.Open()
rs_numRows = 0
%>
thank you for your usefull help again and tell me wehere is the problem in these code please
|