
Client-side Subroutine calling Server-Side Subroutine
Greetings,
Not sure if this is possible. I have a subroutine (below) that performs
actions when called by:
onclick='VBScript:SaveData
"<%=strConnect%>",<%=intMasterAcctID%>,<%=BuildingID%>'
Simple stuff, just doing some stored proceedures. The trick comes that I am
ultimately trying to
get it to take information from a common network drive (common to both the
server and the client)
and using FSO, move files that I desire.
Problem is, that it seems unless I do a server-side subroutine, I cannot
do Server.CreateObject(),
I am limited to CreateObject(), which of course cannot see the Server
drives.
SO... I was thinking something like this:
<script language=vbscript>
Sub ClientSide()
Call ServerScript()
End Sub
</script>
<script language=vbscript runat=server>
Sub ServerScript()
.
.do stuff
.
End Sub
</script>
What I get is a Type Mismatch: ServerScript() error message
The code I need to put in the Server-Side script is commented out below.
Note: I REALLY DO try to figure this stuff out before I ask, but I'm
teaching myself
as I go AND trying to do productive code for a project *sigh*
Regards,
Christopher Klein
<script language=vbscript>
Sub SaveData(strConnect,MasterAcctID,BuildingID)
dim objGet,objPut,ObjDel
sqlDel="execute sp_DeleteSketchInfo " & MasterAcctID & "," & BuildingID
Set objDel=CreateObject("ADODB.RecordSet")
objDel.Open sqlDel,strConnect
Set objDel=Nothing
sqlGet="execute sp_GetSketchTemps " & MasterAcctID & "," & BuildingID
Set objGet=CreateObject("ADODB.RecordSet")
objGet.Open sqlGet,strConnect
If objGet.EOF<>TRUE Then
do until objGet.EOF
vchrCode = objGet("vchrCode")
vchrDescription = objGet("vchrDescription")
lngSQFT = objGet("lngSQFT")
intFinished = objGet("intFinished")
Select Case intFinished
Case False
SpaceType="UNFINISHED"
Case True
SpaceType="FINISHED"
Case Else
SpaceType="UNKNOWN"
End Select
sqlInsert="execute sp_InsertSketchInfo " & _
MasterAcctID & "," & _
BuildingID & ",'" & _
Now() & "','" & _
"NO GPS" & "'," & _
1 & ",'" & _
vchrCode & "','" & _
vchrDescription & "'," & _
lngSQFT & ",'" & _
SpaceType & "'"
set objPut=CreateObject("ADODB.RecordSet")
objPut.Open sqlInsert,strConnect
objGet.MoveNext
Loop
End If
sqlDelete="execute sp_DeleteSketchTemp " & MasterAcctID & "," & BuildingID
Set objDel=CreateObject("ADODB.RecordSet")
ObjDel.Open sqlDelete,strConnect
Set objGet=Nothing
Set objPut=Nothing
Set objDel=Nothing
'---------------------------
' NetworkShare="Z:"
' FileSource=NetworkShare&"\"&"101010."
' FileType1="axf"
' FileType2="jpg"
' dim fso,CopyFile,DelFile,FileStatus,DriveStatus
' set fso=Server.CreateObject("Scripting.FileSystemObject")
'
' DriveStatus=fso.DriveExists(NetworkShare)
' If DriveStatus = True Then
' FileStatus = fso.FileExists(FileSource&FileType1)
' If FileStatus = True Then
' CopyFile = fso.CopyFile(FileSource&FileType1,
"c:\\inetpub\\wwwroot\\Pointsw_rea\\images\\",true)
' DelFile = fso.DeleteFile(FileSource&FileType1)
' End If
' FileStatus=fso.FileExists(FileSource&FileType2)
' If FileStatus = True Then
' CopyFile = fso.CopyFile(FileSource&FileType2,
"c:\\inetpub\\wwwroot\\Pointsw_rea\\images\\",true)
' DelFile = fso.DeleteFile(FileSource&FileType2)
' End If
' End If
'-------------------------
msgbox "Sketch Information Saved!",,"Sketch for Acct:" &MasterAcctID&"
Building: "&BuildingID
window.location.replace("ManageSketch.asp?flg=2")
window.location.reload
End Sub
</script>
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.*-*-*.com/ - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----