R
Rich Cooper
hi, i have a small problme hopfeully there is a simple sollution. I have a
submit button on my page and when a user clicks on it i want them to be able
to change a value is the table doc_profile from Y to N. Here is what i have
so far but it gives me an error in my code. can you write sql code in
vbscript fuctions?
function btnundelete_OnClick
dim oElement, oElements, oCkbox, oconn, rs, ssql, sconnstr
dim bFound, sPIDList, i
Cnt iCnt = 0
bFound = false s
ConnStr = session("ConnStr")
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open sConnStr
oConn.CursorLocation = 3
oConn.CommandTimeout = 0
set rs = Server.CreateObject("adodb.Recordset") rs.CursorLocation = 3
set oElements = document.frmTL.elements
for Each oElement in oElements
if oElement.type= "checkbox" and oElement.checked = true then s
PIDList = sPIDList & " '" & oElement.value & "',"
iCnt = iCnt + 1
end if
next
if len(sPIDList) > 0 then
sPIDList = mid(sPidList, 1, len(sPidlist) - 1)
end if
if iCnt > 0 then
msgbox(icnt)
msgbox(spidlist)
sSql = "update doc_profile set deleteflag = 'n' from doc_profile where pid
=" & spid
set rs = oConn.Execute(sSql)
rs.Close
else call msgbox ("Please make a selction before Undeleting a Doctor.",
vbOKOnly + vbInformation, "Target List")
end if
end function
Any help would be great
submit button on my page and when a user clicks on it i want them to be able
to change a value is the table doc_profile from Y to N. Here is what i have
so far but it gives me an error in my code. can you write sql code in
vbscript fuctions?
function btnundelete_OnClick
dim oElement, oElements, oCkbox, oconn, rs, ssql, sconnstr
dim bFound, sPIDList, i
Cnt iCnt = 0
bFound = false s
ConnStr = session("ConnStr")
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open sConnStr
oConn.CursorLocation = 3
oConn.CommandTimeout = 0
set rs = Server.CreateObject("adodb.Recordset") rs.CursorLocation = 3
set oElements = document.frmTL.elements
for Each oElement in oElements
if oElement.type= "checkbox" and oElement.checked = true then s
PIDList = sPIDList & " '" & oElement.value & "',"
iCnt = iCnt + 1
end if
next
if len(sPIDList) > 0 then
sPIDList = mid(sPidList, 1, len(sPidlist) - 1)
end if
if iCnt > 0 then
msgbox(icnt)
msgbox(spidlist)
sSql = "update doc_profile set deleteflag = 'n' from doc_profile where pid
=" & spid
set rs = oConn.Execute(sSql)
rs.Close
else call msgbox ("Please make a selction before Undeleting a Doctor.",
vbOKOnly + vbInformation, "Target List")
end if
end function
Any help would be great