Problems with getting server validation routine from client script 
Author Message
 Problems with getting server validation routine from client script

I am trying to call a server side validation routine from a client
script.
As you can see, I am using the page object in my code.

I am getting an error:"Page does not support remote scripting"  
Object required 'retObj'

on this line:
if  retObj.return_value > 0 then
-----------------------------------
Here is the client script:
<script Language=VBScript>
sub Form_Validator(downloadlistpost)  
  Dim program_name  
   if  downloadlistpost = 0 then
      program_name= "Ancillary Download Program"
      retObj=thisPage.execute.VerifyBatchID(trim(thisForm.BatchID.value))
      if  retObj.return_value > 0 then
         call msgbox("Batch ID already exists."& Chr(13) & Chr(10) &
Chr(13) & Chr(10)& "Please choose a different Batch ID",,program_name)
         thisForm.BatchID.focus
         exit sub
      ...
      end if
  window.navigate(str)
 end sub    
</script>

Here is the server validation script:
<script Language=VBScript runat=server>
Function VerifyBatchID(BatchID)
   Dim str        
   Dim cn
   Dim rs
   Set cn = CreateObject("ADODB.Connection")
   Set rs = CreateObject("ADODB.Recordset")
   cn.ConnectionString = SQLCNNStr2
   cn.Open
   str= "select distinct BatchName from Batchtable"
   rs.Open str, cn, adOpenKeyset, , adCmdText
   VerifyBatchID= rs.recordcount
End Function

I would really appreciate if someone can help.



Tue, 24 Aug 2004 01:13:40 GMT  
 Problems with getting server validation routine from client script
You do know that there is a newsgroup specifically for InterDev design time control questions, don't you <g>?

microsoft.public.vi.dtc

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--

Quote:

> I am trying to call a server side validation routine from a client
> script.
> As you can see, I am using the page object in my code.

> I am getting an error:"Page does not support remote scripting"  
> Object required 'retObj'

> on this line:
> if  retObj.return_value > 0 then
> -----------------------------------
> Here is the client script:
> <script Language=VBScript>
> sub Form_Validator(downloadlistpost)  
>   Dim program_name  
>    if  downloadlistpost = 0 then
>       program_name= "Ancillary Download Program"
>       retObj=thisPage.execute.VerifyBatchID(trim(thisForm.BatchID.value))
>       if  retObj.return_value > 0 then
>          call msgbox("Batch ID already exists."& Chr(13) & Chr(10) &
> Chr(13) & Chr(10)& "Please choose a different Batch ID",,program_name)
>          thisForm.BatchID.focus
>          exit sub
>       ...
>       end if
>   window.navigate(str)
>  end sub    
> </script>

> Here is the server validation script:
> <script Language=VBScript runat=server>
> Function VerifyBatchID(BatchID)
>    Dim str        
>    Dim cn
>    Dim rs
>    Set cn = CreateObject("ADODB.Connection")
>    Set rs = CreateObject("ADODB.Recordset")
>    cn.ConnectionString = SQLCNNStr2
>    cn.Open
>    str= "select distinct BatchName from Batchtable"
>    rs.Open str, cn, adOpenKeyset, , adCmdText
>    VerifyBatchID= rs.recordcount
> End Function

> I would really appreciate if someone can help.



Tue, 24 Aug 2004 05:08:37 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Paradox, Referential Integrity, DbiDoRestructure, SQL

2. Pascal variable exchange

3. getting server variables to client side scripting

4. Problems with Form.Submit in validation routine

5. Date validation routine problems

6. Date validation routine problems

7. Date validation routine problems

8. Help: problem passing variable between client/server scripts

9. Problem sharing script code on client and server side

10. Help: problem passing variable between client/server scripts

11. Saving Binary Files

12. Help With AVI files

 

 
Powered by phpBB® Forum Software