Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"CreateObject" active for one user at a time

Status
Not open for further replies.

JeroenDortmans

Technical User
Aug 7, 2001
56
NL
Hi,

I use ActiveX "CreateObject" to create a BAT file. The contents of this BAT file partly comes from a database. Immediately after creating the BAT file, it will be "executed" and an application is started with the right parameter, which comes from the database.
When different users will run this script at the same time the problem could occur that one or more of the users will "execute" a BAT file with the wrong database value. Therefore, the application is started with the wrong parameter. How can I modify the script so that it will wait until 1 session of 1 user is finished? Can I do this with "SessionID"?
 
Here is the code I use. Maybe it helps to explain some things.

<body>
<!--#include file=&quot;../_fpclass/fpdblib.inc&quot;-->
<%
fp_sQry=&quot;SELECT * FROM Connectoren WHERE (Drawing_number = '::Drawing_number::')&quot;
fp_sDefault=&quot;Drawing_number=&quot;
fp_sNoRecords=&quot;Geen records geretourneerd.&quot;
fp_sDataConn=&quot;COCO&quot;
fp_iMaxRecords=1
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=&quot;&quot;
fp_sMenuValue=&quot;&quot;
fp_iDisplayCols=1
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file=&quot;../_fpclass/fpdbrgn1.inc&quot;-->

<%
DIM Path_BAT, DrawingNrVar, ComplPath, ServerPath
Path_BAT = &quot;\\IS0001\Shared_Apps\DAF_Progs\Vog\VOG&quot;
DrawingNrVar = FP_FieldVal(fp_rs,&quot;Drawing_number&quot;)
ComplPath = Path_BAT + &quot; &quot; + DrawingNrVar + &quot;*&quot;
ServerPath = Server.MapPath(&quot;Temp_BAT_file\View_VOG.BAT&quot;)

DIM filesys, filetxt, getname, path
Set filesys = CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set filetxt = filesys.CreateTextFile (ServerPath, True)
path = filesys.GetAbsolutePathName (ServerPath)
getname = filesys.GetFileName(path)
filetxt.WriteLine (&quot;echo off&quot;)
filetxt.WriteLine (ComplPath)
filetxt.WriteLine (&quot;exit&quot;)
filetxt.Close
%>

<p>
<%=FP_FieldVal(fp_rs,&quot;Drawing_number&quot;)%>
</p>
<!--#include file=&quot;../_fpclass/fpdbrgn2.inc&quot;-->

<p align=&quot;left&quot;><b><font size=&quot;5&quot;>Starting VOG...</font></b></p>

<script>
function openpopup()
{
var popUpWindow=&quot;Temp_BAT_file/View_VOG.BAT&quot;
winpops=window.open(popUpWindow)
}
openpopup()
</script>

<script language=javascript>
close()
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top