 |
|
 |
|
06-29-04 02:56 PM
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
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Submit button Question |
 |
 |
|
|
06-29-04 02:56 PM
Maybe it would help if you told us what the error actually is.
Cheers
Ken
"Rich Cooper" <richard.cooper@pdatasvcs.com> wrote in message
news:%23cj%23TedXEHA.1440@TK2MSFTNGP12.phx.gbl...
: 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
:
:
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Submit button Question |
 |
 |
|
|
06-29-04 02:56 PM
the error is it won't chnage that value in my table from y to n. It says
error on page.
"Ken Schaefer" <kenREMOVE@THISadOpenStatic.com> wrote in message
news:OICb77dXEHA.1656@TK2MSFTNGP09.phx.gbl...
> Maybe it would help if you told us what the error actually is.
>
> Cheers
> Ken
>
>
> "Rich Cooper" <richard.cooper@pdatasvcs.com> wrote in message
> news:%23cj%23TedXEHA.1440@TK2MSFTNGP12.phx.gbl...
> : 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
> :
> :
>
>
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Submit button Question |
 |
 |
|
|
06-29-04 02:56 PM
On Tue, 29 Jun 2004 09:51:22 -0400, "Rich Cooper"
<richard.cooper@pdatasvcs.com> wrote:
>the error is it won't chnage that value in my table from y to n. It says
>error on page.
How about the *exact* error message? In full.
Jeff
>"Ken Schaefer" <kenREMOVE@THISadOpenStatic.com> wrote in message
>news:OICb77dXEHA.1656@TK2MSFTNGP09.phx.gbl...
>have
>pid
>
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
RE: Submit button Question |
 |
 |
|
|
06-29-04 10:55 PM
you cant run a vbscript function(server side) from a javascript.onlick even(
clientside)
asp doesnt even know the button exists.
"Rich Cooper" wrote:
> 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 ab
le
> to change a value is the table doc_profile from Y to N. Here is what i ha
ve
> 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
>
>
>
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
 |
Re: Submit button Question |
 |
 |
|
|
06-30-04 08:35 AM
You mean in the Internet Explorer status bar? That's a client-side
javascript/vbscript error. It means your client-side script is running into
a problem. If this is classic ASP, you need to submit the form back to the
server in order to have the ASP run - ASP only runs on the server (Active
*Server* Pages).
Cheers
Ken
"Rich Cooper" <richard.cooper@pdatasvcs.com> wrote in message
news:OiyMHAeXEHA.3044@TK2MSFTNGP09.phx.gbl...
: the error is it won't chnage that value in my table from y to n. It says
: error on page.
: "Ken Schaefer" <kenREMOVE@THISadOpenStatic.com> wrote in message
: news:OICb77dXEHA.1656@TK2MSFTNGP09.phx.gbl...
: > Maybe it would help if you told us what the error actually is.
: >
: > Cheers
: > Ken
: >
: >
: > "Rich Cooper" <richard.cooper@pdatasvcs.com> wrote in message
: > news:%23cj%23TedXEHA.1440@TK2MSFTNGP12.phx.gbl...
: > : 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
: > :
: > :
: >
: >
:
:
[ Post a follow-up to this message ]
|
|
|
 |
|
 |
|
 |
|
|
|
Sponsored Links |
 |
 |
|
|
 |
All times are GMT. The time now is 09:23 AM. |
 |
|
|
 |
|
 |
|
|
 |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
|
|
|
|
Medical and Health forum | Computer Games Reviews | Graphics design forum
|
 |
|
 |
|