|
The idea you got in reply was 'it's probably not possible', with a link to an online reference. 'Any other ideas' does not seem a valid response to me. I doubt very much that pass by reference exists in jscript, and certainly your approach (write a function called ref and hope it passes things magically by reference ) is not going to work.
It may be possible, but neither I nor your other respondent think it is. You should go to a bigger jscript forum if you hope for a better answer. Better yet, if it is possible, google is bound to know about it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you for explaining minhpc_bk's post to me.
'Any other ideas' means that I'm still asking for help. It's not a reply to minhpc_bk's post. In fact, minhpc_bk's post helped me a lot.
Christian Graus wrote:
...write a function called ref and hope it passes things magically by reference...
This is just an example, I don't hope it's going to magically work.
Google Groups - "Function arguments by reference"[^].
|
|
|
|
|
Doing so only changes the result property of the dummyArg.value , but not the obj.result . You can see that with:
alert(dummyArg.value.result);
Stanimir Angeloff wrote:
Any other ideas?
I'm not sure I have other than you'll have to edit the property of the object instead of assigning another object to the function parameter.
PS: Nice formatting!
|
|
|
|
|
Thank you again for your reply.
I'm sorry if my previous post was rude. Btw, try this CodeColorizer[^].
|
|
|
|
|
minhpc_bk wrote:
check out the core javascript reference
Nice. That gave a definite answer right away:
"All parameters are passed to functions by value"
That means that the reference to an object also is passed by value. That in turn gives that you can change the contents of the object, but you cannot change the reference to the object.
But this opens up a different way of doing it. As you can modify the contents of an object, you only have to place the reference inside an object in order to be able to change it from inside the function.
This is an example that shows an object containing a refernce to another object:
function modify(obj) {<br />
obj.ref = new String("42");<br />
}<br />
<br />
var info = new String("1");<br />
var o = new Object();<br />
o.ref = info;<br />
modify(o);<br />
alert(info);<br />
alert(o.ref);
It will create an object, and then another object that will contain a reference to it. It then passes the object to the function that will replace the reference with a reference to a new object. The code then displays the value of the first object to show that the function has not changed it's value, and displays the value of the referenced object to show that the function successfully changed the reference.
---
b { font-weight: normal; }
|
|
|
|
|
Google Groups - "Function arguments by reference"[^].
Eric Lippert wrote:
The question "are strings passed by value or by reference" is not a fruitful
question to ask. The answer is "it doesn't matter, because there is NO WAY
TO MODIFY A STRING."
|
|
|
|
|
HI
I have a question about a textbox control.
The input can only be numbers and a ,.
It's to input a money value.
Can anybody help me please.
|
|
|
|
|
You can use a RegularExpressionValidator to validate the field, with the expression "\d*(,\d*)?". This will allow at most one comma in the input.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for helping me.
|
|
|
|
|
hi sir,
i'm getting the following error after hitting the upload button:
***********************************************************
Response object error 'ASP 0185 : 80020003'
Missing Default Property
?
A default property was not found for the object.
****************************************************
i'm sending all three files regarding this problem kindly help me out..
*********************************************************
file1:clsupload.asp
Class clsUpload
'========================================================='
' This class will parse the binary contents of the '
' request, and populate the Form and Files collections. '
'========================================================='
Private m_objFiles
Private m_objForm
Public Property Get Form()
Set Form = m_objForm
End Property
Public Property Get Files()
Set Files = m_objFiles
End Property
Private Sub Class_Initialize()
Set m_objFiles = New clsCollection
Set m_objForm = New clsCollection
ParseRequest
End Sub
Private Sub ParseRequest()
Dim lngTotalBytes, lngPosBeg, lngPosEnd, lngPosBoundary, lngPosTmp, lngPosFileName
Dim strBRequest, strBBoundary, strBContent
Dim strName, strFileName, strContentType, strValue, strTemp
Dim objFile
'Grab the entire contents of the Request as a Byte string
lngTotalBytes = Request.TotalBytes
strBRequest = Request.BinaryRead(lngTotalBytes)
'Find the first Boundary
lngPosBeg = 1
lngPosEnd = InStrB(lngPosBeg, strBRequest, UStr2Bstr(Chr(13)))
If lngPosEnd > 0 Then
strBBoundary = MidB(strBRequest, lngPosBeg, lngPosEnd - lngPosBeg)
lngPosBoundary = InStrB(1, strBRequest, strBBoundary)
End If
If strBBoundary = "" Then
'The form must have been submitted *without* ENCTYPE="multipart/form-data"
'But since we already called Request.BinaryRead, we can no longer access
'the Request.Form collection, so we need to parse the request and populate
'our own form collection.
lngPosBeg = 1
lngPosEnd = InStrB(lngPosBeg, strBRequest, UStr2BStr("&"))
Do While lngPosBeg < LenB(strBRequest)
'Parse the element and add it to the collection
strTemp = BStr2UStr(MidB(strBRequest, lngPosBeg, lngPosEnd - lngPosBeg))
lngPosTmp = InStr(1, strTemp, "=")
strName = URLDecode(Left(strTemp, lngPosTmp - 1))
strValue = URLDecode(Right(strTemp, Len(strTemp) - lngPosTmp))
m_objForm.Add strName, strValue
'Find the next element
lngPosBeg = lngPosEnd + 1
lngPosEnd = InStrB(lngPosBeg, strBRequest, UStr2BStr("&"))
If lngPosEnd = 0 Then lngPosEnd = LenB(strBRequest) + 1
Loop
Else
'The form was submitted with ENCTYPE="multipart/form-data"
'Loop through all the boundaries, and parse them into either the
'Form or Files collections.
Do Until (lngPosBoundary = InStrB(strBRequest, strBBoundary & UStr2Bstr("--")))
'Get the element name
lngPosTmp = InStrB(lngPosBoundary, strBRequest, UStr2BStr("Content-Disposition"))
lngPosTmp = InStrB(lngPosTmp, strBRequest, UStr2BStr("name="))
lngPosBeg = lngPosTmp + 6
lngPosEnd = InStrB(lngPosBeg, strBRequest, UStr2BStr(Chr(34)))
strName = BStr2UStr(MidB(strBRequest, lngPosBeg, lngPosEnd - lngPosBeg))
'Look for an element named 'filename'
lngPosFileName = InStrB(lngPosBoundary, strBRequest, UStr2BStr("filename="))
'If found, we have a file, otherwise it is a normal form element
If lngPosFileName <> 0 And lngPosFileName < InStrB(lngPosEnd, strBRequest, strBBoundary) Then 'It is a file
'Get the FileName
lngPosBeg = lngPosFileName + 10
lngPosEnd = InStrB(lngPosBeg, strBRequest, UStr2BStr(chr(34)))
strFileName = BStr2UStr(MidB(strBRequest, lngPosBeg, lngPosEnd - lngPosBeg))
'Get the ContentType
lngPosTmp = InStrB(lngPosEnd, strBRequest, UStr2BStr("Content-Type:"))
lngPosBeg = lngPosTmp + 14
lngPosEnd = InstrB(lngPosBeg, strBRequest, UStr2BStr(chr(13)))
strContentType = BStr2UStr(MidB(strBRequest, lngPosBeg, lngPosEnd - lngPosBeg))
'Get the Content
lngPosBeg = lngPosEnd + 4
lngPosEnd = InStrB(lngPosBeg, strBRequest, strBBoundary) - 2
strBContent = MidB(strBRequest, lngPosBeg, lngPosEnd - lngPosBeg)
If strFileName <> "" And strBContent <> "" Then
'Create the File object, and add it to the Files collection
Set objFile = New clsFile
objFile.Name = strName
objFile.FileName = Right(strFileName, Len(strFileName) - InStrRev(strFileName, "\"))
objFile.ContentType = strContentType
objFile.Blob = strBContent
m_objFiles.Add strName, objFile
End If
Else 'It is a form element
'Get the value of the form element
lngPosTmp = InStrB(lngPosTmp, strBRequest, UStr2BStr(chr(13)))
lngPosBeg = lngPosTmp + 4
lngPosEnd = InStrB(lngPosBeg, strBRequest, strBBoundary) - 2
strValue = BStr2UStr(MidB(strBRequest, lngPosBeg, lngPosEnd - lngPosBeg))
'Add the element to the collection
m_objForm.Add strName, strValue
End If
'Move to Next Element
lngPosBoundary = InStrB(lngPosBoundary + LenB(strBBoundary), strBRequest, strBBoundary)
Loop
End If
End Sub
Private Function BStr2UStr(BStr)
'Byte string to Unicode string conversion
Dim lngLoop
BStr2UStr = ""
For lngLoop = 1 to LenB(BStr)
BStr2UStr = BStr2UStr & Chr(AscB(MidB(BStr,lngLoop,1)))
Next
End Function
Private Function UStr2Bstr(UStr)
'Unicode string to Byte string conversion
Dim lngLoop
Dim strChar
UStr2Bstr = ""
For lngLoop = 1 to Len(UStr)
strChar = Mid(UStr, lngLoop, 1)
UStr2Bstr = UStr2Bstr & ChrB(AscB(strChar))
Next
End Function
Private Function URLDecode(Expression)
'Why doesn't ASP provide this functionality for us?
Dim strSource, strTemp, strResult
Dim lngPos
strSource = Replace(Expression, "+", " ")
For lngPos = 1 To Len(strSource)
strTemp = Mid(strSource, lngPos, 1)
If strTemp = "%" Then
If lngPos + 2 < Len(strSource) Then
strResult = strResult & Chr(CInt("&H" & Mid(strSource, lngPos + 1, 2)))
lngPos = lngPos + 2
End If
Else
strResult = strResult & strTemp
End If
Next
URLDecode = strResult
End Function
End Class
Class clsCollection
'========================================================='
' This class is a pseudo-collection. It is not a real '
' collection, because there is no way that I am aware '
' of to implement an enumerator to support the '
' For..Each syntax using VBScript classes. '
'========================================================='
Private m_objDicItems
Private Sub Class_Initialize()
Set m_objDicItems = Server.CreateObject("Scripting.Dictionary")
m_objDicItems.CompareMode = vbTextCompare
End Sub
Public Property Get Count()
Count = m_objDicItems.Count
End Property
Public Default Function Item(Index)
Dim arrItems
If IsNumeric(Index) Then
arrItems = m_objDicItems.Items
If IsObject(arrItems(Index)) Then
Set Item = arrItems(Index)
Else
Item = arrItems(Index)
End If
Else
If m_objDicItems.Exists(Index) Then
If IsObject(m_objDicItems.Item(Index)) Then
Set Item = m_objDicItems.Item(Index)
Else
Item = m_objDicItems.Item(Index)
End If
End If
End If
End Function
Public Function Key(Index)
Dim arrKeys
If IsNumeric(Index) Then
arrKeys = m_objDicItems.Keys
Key = arrKeys(Index)
End If
End Function
Public Sub Add(Name, Value)
If m_objDicItems.Exists(Name) Then
m_objDicItems.Item(Name) = Value
Else
m_objDicItems.Add Name, Value
End If
End Sub
End Class
Class clsFile
'========================================================='
' This class is used as a container for a file sent via '
' an http multipart/form-data post. '
'========================================================='
Private m_strName
Private m_strContentType
Private m_strFileName
Private m_Blob
Public Property Get Name() : Name = m_strName : End Property
Public Property Let Name(vIn) : m_strName = vIn : End Property
Public Property Get ContentType() : ContentType = m_strContentType : End Property
Public Property Let ContentType(vIn) : m_strContentType = vIn : End Property
Public Property Get FileName() : FileName = m_strFileName : End Property
Public Property Let FileName(vIn) : m_strFileName = vIn : End Property
Public Property Get Blob() : Blob = m_Blob : End Property
Public Property Let Blob(vIn) : m_Blob = vIn : End Property
Public Sub Save(Path)
Dim objFSO, objFSOFile
Dim lngLoop
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Response.Write(objfso)
Set objFSOFile = objFSO.CreateTextFile(objFSO.BuildPath(Path, m_strFileName))
For lngLoop = 1 to LenB(m_Blob)
objFSOFile.Write Chr(AscB(MidB(m_Blob, lngLoop, 1)))
Next
objFSOFile.Close
End Sub
End Class
************************************************************
***********************************************************
file2:system_config.asp
<%@ Language=VBScript %>
<%
call OpenDataCon
if Request.QueryString("MOVE")="NEXT" then
if (cstr(trim(Session("CurrentPage")))=cstr(trim(request("pgcount")))) then
Session("CurrentPage")=Session("CurrentPage")
else
Session("CurrentPage")=Session("CurrentPage")+1
end if
end if
if Request.QueryString("MOVE")="PREV" then
Session("CurrentPage")=Session("CurrentPage")-1
end if
if Request.QueryString("MOVE")="" then
Session("CurrentPage")=1
end if
%>
<%
Dim objUpload, lngLoop,mTemplate
'If Request.TotalBytes > 0 Then
Set objUpload = New clsUpload
dim msno
msno=0
set rst=Server.CreateObject("ADODB.recordset")
rst.CursorLocation=3
if Request.QueryString ("chkadd")="1" then
strcnt="select count(sno) as cnt from system_config"
rst.Open strcnt, mycon
cnt=cint(rst("cnt"))
rst.Close()
if cnt=0 then
msno=1
else
mysql="select max(sno) as msno from system_config"
rst.Open mysql, mycon
msno=cint(rst("msno"))
msno=msno+1
'rst.Close()
end if
dim ii,iii,iiii,iiiii,KK
ii=ret_date(objUpload.Form.Item("txtfrdt"))
if ii<>null then
ii="'"+cstr(datevalue(ii))+"'"
end if
iii=ret_date(objUpload.Form.Item("txttodt"))
if iii<>null then
iii="'"+cstr(datevalue(iii))+"'"
end if
iiii=ret_date(objUpload.Form.Item("txtwrdt"))
if iiii<>null then
iiii="'"+cstr(datevalue(iiii))+"'"
end if
iiiii=ret_date(objUpload.Form.Item("txtprnwrdt"))
if iiiii<>null then
iiiii="'"+cstr(datevalue(iiiii))+"'"
end if
if KK<>null then
KK=ret_date(objUpload.Form.Item("txtscnwrdt"))
KK="'"+cstr(datevalue(KK))+"'"
end if
'call MyUpload()
'objUpload.Form.Item("seluname")
'Response.Write(ii)
'Response.End
mysql="insert into System_Config (sno,user_name,fr_date,to_date,Room_no,Computer_brand,Model,Serial_no,ProcessTyp_Spd,HDD_capacity,RAM,Monitor_Typ,Monitor_Sno,Keyboard,Keyboard_sno,Mouse,Mouse_sno,CDROM_DVD,CDROM_sno,CDWriter_combo,CDWriter_sno,Warranty_Exp_dt,Syst_Confg_Html,Printer_brand,Printer_type,Printer_model,Printer_sno,Printer_Warranty_Exp_Dt, "&_
" Scanner_brand,Scanner_type,Scanner_model,Scanner_sno) " &_
" values("&msno&",'"+objUpload.Form.Item("seluname")+"',"+ii+","+iii+",'"+objUpload.Form.Item("txtrmno")+"','"+objUpload.Form.Item("selcompbrand")+"','"+objUpload.Form.Item("txtmodel")+"','"+objUpload.Form.Item("txtsrno")+"', " &_
" '"+objUpload.Form.Item("selprocessor")+"','"+objUpload.Form.Item("selhdd")+"','"+objUpload.Form.Item("selram")+"','"+objUpload.Form.Item("selmonitor")+"','"+objUpload.Form.Item("txtmsrno")+"','"+objUpload.Form.Item("selkeyb")+"','"+objUpload.Form.Item("txtkeybsno")+"','"+objUpload.Form.Item("selmouse")+"','"+objUpload.Form.Item("txtmousesno")+"'," &_
" '"+objUpload.Form.Item("txtcdrom")+"','"+objUpload.Form.Item("txtcdrsno")+"','"+objUpload.Form.Item("txtcdwr")+"','"+objUpload.Form.Item("txtcdwsno")+"',"+iiii+",'"+objUpload.Form.Item("txtFilename1")+"'," &_
" '"+objUpload.Form.Item("selprinterbrand")+"','"+objUpload.Form.Item("selprn_typ")+"','"+objUpload.Form.Item("txtprnmodel")+"','"+objUpload.Form.Item("txtprnsno")+"',"+iiiii+", " &_
" '"+objUpload.Form.Item("selsacnnerbrand")+"','"+objUpload.Form.Item("selscan_typ")+"','"+objUpload.Form.Item("txtscnmodel")+"','"+objUpload.Form.Item("txtscnsno")+"' )"
Response.Write(mysql)
Response.End
mycon.execute mysql
Response.Redirect("system_config.asp")
end if
'*****************************************************
'mysql="select max(sno) as sno from system_config"
'Response.Write sno
'Response.End
'rst.Open mysql, mycon
mysql="select * from system_config order by sno"
'Response.Write mysql
'Response.End
rst.Open mysql, mycon
dim Cnt
if not rst.EOF then
Cnt=rst.RecordCount
'Response.Write Cnt
'Response.End
rst.PageSize=5
rst.AbsolutePage=Session("CurrentPage")
end if
ii=ret_date(objUpload.Form.Item("txtfrdt"))
if ii<>null then
ii="'"+cstr(datevalue(ii))+"'"
end if
iii=ret_date(objUpload.Form.Item("txttodt"))
if iii<>null then
iii="'"+cstr(datevalue(iii))+"'"
end if
iiii=ret_date(objUpload.Form.Item("txtwrdt"))
if iiii<>null then
iiii="'"+cstr(datevalue(iiii))+"'"
end if
iiiii=ret_date(objUpload.Form.Item("txtprnwrdt"))
if iiiii<>null then
iiiii="'"+cstr(datevalue(iiiii))+"'"
end if
if KK<>null then
KK=ret_date(objUpload.Form.Item("txtscnwrdt"))
KK="'"+cstr(datevalue(KK))+"'"
end if
'rst.Close
'******************************update******************
dim sqlmod
if Request.QueryString("chkupdt")=1 then
ii=ret_date(objUpload.Form.Item("txtfrdt"))
if ii<>null then
ii="'"+cstr(datevalue(ii))+"'"
end if
call MyUpload()
sqlmod="update system_config set user_name='"+objUpload.Form.Item("seluname")+"',fr_date="+ii+",to_date="+iii+",Room_no='"+objUpload.Form.Item("txtrmno")+"',computer_brand='"+objUpload.Form.Item("selcompbrand")+"'," &_
"Model='"+objUpload.Form.Item("txtmodel")+"',Serial_no='"+objUpload.Form.Item("txtsrno")+"',ProcessTyp_Spd='"+objUpload.Form.Item("selprocessor")+"',HDD_capacity='"+objUpload.Form.Item("selhdd")+"',RAM='"+objUpload.Form.Item("selram")+"'," &_
"Monitor_Typ='"+objUpload.Form.Item("selmonitor")+"',Monitor_sno='"+objUpload.Form.Item("txtmsrno")+"',Keyboard='"+objUpload.Form.Item("selkeyb")+"',Keyboard_sno='"+objUpload.Form.Item("txtkeybsno")+"',Mouse='"+objUpload.Form.Item("selmouse")+"',mouse_sno='"+objUpload.Form.Item("txtmousesno")+"'," &_
"CDROM_DVD='"+objUpload.Form.Item("txtcdrom")+"',CDROM_sno='"+objUpload.Form.Item("txtcdrsno")+"',CDWriter_combo='"+objUpload.Form.Item("txtcdwr")+"',CDWriter_sno='"+objUpload.Form.Item("txtcdwsno")+"',Warranty_Exp_dt="+iiii+",Syst_Confg_Html='"+objUpload.Form.Item("txtFilename1")+"' ," &_
"Printer_brand= '"+objUpload.Form.Item("selprinterbrand")+"',Printer_type= '"+objUpload.Form.Item("selprn_typ")+"',Printer_model= '"+objUpload.Form.Item("txtprnmodel")+"',Printer_sno= '"+objUpload.Form.Item("txtprnsno")+"',Printer_Warranty_Exp_Dt="+objUpload.Form.Item("txtprnwrdt")+", " &_
"Scanner_brand= '"+objUpload.Form.Item("selsacnnerbrand")+"',Scanner_type= '"+objUpload.Form.Item("selscan_typ")+"',Scanner_model= '"+objUpload.Form.Item("txtscnmodel")+"',Scanner_sno= '"+objUpload.Form.Item("txtscnsno")+"' " &_
" where sno="&objUpload.Form.Item("chkbox")&""
Response.Write(sqlmod)
Response.End
mycon.execute sqlmod
Response.Redirect("system_Config.asp")
end if
'*************************************Delete************************
if Request.QueryString("chkdel")=1 then
dim a()
i=1
redim a(10)
for each value in Request.QueryString("chkbox")
if value <> "" then
if i >10 then redim preserve a(20)
a(i)=value
end if
i=i+1
next
if i > 1 then
for j=1 to i-1
sqldelete="delete from system_config where sno =" & a(j) & " "
Response.Write sqldelete
Response.End
MyCon.Execute sqldelete
next
end if
Response.Redirect("system_config.asp")
end if
%>
<title>System Configuration
Home
System Configuration
<% set rst1=Server.CreateObject("ADODB.recordset")
rst1.CursorLocation=3
strcnt1="select count(sno) as cnt from system_config"
'Response.Write strcnt1
'Response.End
'Response.Write (cnt)
'Response.End
rst1.Open strcnt1, mycon
cnt=cint(rst1("cnt"))
'Response.Write (cnt)
'Response.End
'rst.Close()
%>
">
<%
dim strcnt1,mysql1,msno1
msno1=0
set rst1=Server.CreateObject("ADODB.recordset")
rst1.CursorLocation=3
'if Request.QueryString ("chkadd")="1" then
strcnt1="select count(sno) as cnt from system_config"
'Response.Write cnt
'Response.End
rst1.Open strcnt1, mycon
cnt=cint(rst1("cnt"))
rst1.Close()
if cnt=0 then
msno1=1
else
mysql1="select max(sno) as msno1 from system_config"
rst1.Open mysql1, mycon
msno1=cint(rst1("msno1"))
' while 1=1
'Response.Write msno1
'Response.End
'rst.Close()
%>
<%
msno1=msno1+1
'wend
end if
%>
User Name : |
<%set rstuser=server.CreateObject("ADODB.recordset")
rstuser.CursorLocation=3
mysql="select name from usr_sys_mast order by name"
rstuser.Open mysql,mycon%>
-
<%while not rstuser.EOF%>
<%=rstuser(0)%>
<%rstuser.MoveNext%>
<%wend%>
<%rstuser.Close()%>
| Room No : |
| From Date : |
MM-DD-YYYY | To Date : |
MM-DD-YYYY | Brand : |
<%set rstcmpbr=Server.CreateObject("ADODB.Recordset")
rstcmpbr.CursorLocation=3
mysql="select brand_name from Hardwarebrand order by brand_name"
rstcmpbr.Open mysql, mycon%>
-
<%while not rstcmpbr.EOF%>
<%=rstcmpbr(0)%>
<%rstcmpbr.MoveNext%>
<%wend%>
<%rstcmpbr.Close()%>
| Model/Type : |
| Computer S/N : |
| Processor Type & Speed : |
<%set rstpro=server.CreateObject("ADODB.recordset")
rstpro.CursorLocation=3
str="select process_name from Processor_master order by process_name"
rstpro.Open str,mycon%>
-
<%while not rstpro.EOF%>
><%=rstpro.Fields(0)%>
<%rstpro.MoveNext%>
<%wend%>
<%rstpro.Close()%>
| HDD Capacity : |
<%set rsthdd=Server.CreateObject("ADODB.recordset")
rsthdd.CursorLocation=3
str="select hdd_name from hdd_master order by hdd_name "
rsthdd.Open str,mycon%>
-
<%while not rsthdd.EOF%>
><%=rsthdd.Fields(0)%>
<%rsthdd.MoveNext%>
<%wend%>
<%rsthdd.Close()%>
| RAM : |
<%set rstram=Server.CreateObject("ADODB.recordset")
rstram.CursorLocation=3
str="select Ram_name from RAM_Master order by Ram_name"
rstram.Open str,mycon%>
-
<%while not rstram.EOF%>
><%=rstram.Fields(0)%>
<%rstram.MoveNext%>
<%wend%>
<%rstram.Close()%>
| Monitor Type : |
<%
set rstmonitor=Server.CreateObject("ADODB.recordset")
rstmonitor.CursorLocation=3
str="select mon_name from monitor_master order by mon_name"
rstmonitor.Open str,mycon%>
-
<%while not rstmonitor.EOF %>
><%=rstmonitor.Fields(0)%>
<%rstmonitor.MoveNext%>
<%wend%>
<%rstmonitor.Close()%>
| Monitor S/N : |
| Keyboard : |
<%
set rstk=server.CreateObject("ADODB.recordset")
rstk.cursorlocation=3
str="select keyb_name from keyboard_master order by keyb_name"
rstk.open str,mycon
%>
-
<%while not rstk.eof%>
><%=rstk.fields(0)%>
<%rstk.movenext%>
<%wend%>
<%rstk.close()%>
| Keyboard S/N : |
| Mouse Type : |
<%set rstmouse=server.CreateObject("ADODB.recordset")
rstmouse.CursorLocation =3
str="select mous_name from mouse_master order by mous_name"
rstmouse.open str,mycon %>
-
<%while not rstmouse.eof%>
><%=rstmouse.fields(0)%>
<%rstmouse.movenext%>
<%wend%>
<%rstmouse.close()%>
| Mouse S/N : |
| CD ROM/DVD : | | CD ROM/DVD S/N : | | CD Writer/Combo : | | CD Writer/Combo S/N : | | Warranty Expiry Date : |
MM-DD-YYYY | System Configuration Html file : | Upload File1 | DownLoad
File1 |
| Printer Brand : |
<%set rstcmpprinter=Server.CreateObject("ADODB.Recordset")
rstcmpprinter.CursorLocation=3
mysql="select brand_name from Printer_Master order by brand_name"
rstcmpprinter.Open mysql, mycon%>
-
<%while not rstcmpprinter.EOF%>
<%=rstcmpprinter(0)%>
<%rstcmpprinter.MoveNext%>
<%wend%>
<%rstcmpprinter.Close()%>
| Printer Type : |
<%
set rstprn_typ=Server.CreateObject("ADODB.recordset")
rstprn_typ.CursorLocation=3
str="select Prn_name from Printer_Type order by Prn_name"
rstprn_typ.Open str,mycon%>
-
<%while not rstprn_typ.EOF %>
><%=rstprn_typ.Fields(0)%>
<%rstprn_typ.MoveNext%>
<%wend%>
<%rstprn_typ.Close()%>
| Printer Model : |
| Printer S/N : |
| Printer Warranty Expiry Date : |
MM-DD-YYYY | Scanner Brand : |
<%set rstcmpsacnner=Server.CreateObject("ADODB.Recordset")
rstcmpsacnner.CursorLocation=3
mysql="select brand_name from Scanner_Master order by brand_name"
rstcmpsacnner.Open mysql, mycon%>
-
<%while not rstcmpsacnner.EOF%>
<%=rstcmpsacnner(0)%>
<%rstcmpsacnner.MoveNext%>
<%wend%>
<%rstcmpsacnner.Close()%>
| Scanner Type : |
<%
set rstsacn_typ=Server.CreateObject("ADODB.recordset")
rstsacn_typ.CursorLocation=3
str="select Scn_name from Scanner_Type order by Scn_name"
rstsacn_typ.Open str,mycon%>
-
<%while not rstsacn_typ.EOF %>
><%=rstsacn_typ.Fields(0)%>
<%rstsacn_typ.MoveNext%>
<%wend%>
<%rstsacn_typ.Close()%>
| Scanner Model : |
| Scanner S/N : |
| Scanner Warranty Expiry Date : |
MM-DD-YYYY |
<%NumRows=0
while not rst.EOF and NumRows < rst.PageSize%>
">
<%rst.MoveNext
NumRows=NumRows+1
wend
'rst.Close()%>
Select | User Name | Room No | Computer Brand | Monitor Type | Keyboard | Mouse | > | <%=rst("user_name")%> | <%=rst("Room_no")%> | <%=rst("Computer_brand")%> | <%=rst("Monitor_typ")%> | <%=rst("Keyboard")%> | <%=rst("Mouse")%> |
<%if Session("CurrentPage") >1 then%>
[PREV]
<%end if%>
<%if Session("CurrentPage")< rst.PageCount then %>
[NEXT]
<%end if%>
<%
Function FixNull(mvar)
if isnull(mvar) then FixNull="" else Fixnull=mvar
end function
%>
<%
Function setnull(str)
If (IsEmpty(str) Or str = " ") Then setnull = Null Else setnull = str
End Function
dim ret_str,ret_numb
function ret_date(mdate)
if mdate<>"" then
ret_date="datevalue(cstr('"+mdate+"'))"
else
ret_date="null"
end if
end function
%>
************************************************************
file3: FileUpload1.asp
****************************************************
<%@ Language=VBScript %>
<%
'sr_no=request("sr_no")
mtype = request("mtype")
fileno = request("fileno")
'Response.Write(request("fileno"))
'Response.End()%>
<title>Uploading Files
Close
>
Please select the file to be uploaded:
<%
Dim objUpload, lngLoop
If Request.TotalBytes > 0 Then
Set objUpload = New clsUpload
%>
File(s) Uploaded: <%= objUpload.Files.Count %>
<%
'Response.Write(objUpload.Filename)
For lngLoop = 0 to objUpload.Files.Count - 1
'If accessing this page annonymously,
'the internet guest account must have
'write permission to the path below.
' objUpload.Files.Item(lngLoop).Save "e:\data\"
if mtype = "MR" then
objUpload.Files.Item(lngLoop).Save (server.MapPath("MR"))
elseif mtype = "PR" then
objUpload.Files.Item(lngLoop).Save (server.MapPath("PR"))
elseif mtype = "PhotoGal" then
objUpload.Files.Item(lngLoop).Save (server.MapPath("PHOTOGAL"))
else
objUpload.Files.Item(lngLoop).Save (server.MapPath("CV"))
end if
Next
End If
%>
************************************************************
thanks and regards
pankaj.
|
|
|
|
|
1) Hundreds of lines of rubbish, to which nobody (but you) care about
2) No description of the problem other than "Error message blah blah blah" in subject line
3) In addition to 2) not even any info about the error message you recieved
Were you REALLY expecing any sort of answer?
|
|
|
|
|
J4amieC wrote:
2) No description of the problem other than "Error message blah blah blah" in subject line
3) In addition to 2) not even any info about the error message you recieved
Well, actually there is some more information a bit into the code. First there is the long code of the actual page, then some info, and finally a huge library that is used by the page.
The information is not very informative, though. It's mainly an error message, but without any information on where in the code the error occured.
---
b { font-weight: normal; }
|
|
|
|
|
I try do deploy a winform .exe application via internet explorer. The first time when accessed it's ok, but then always starts the old version. As far as I understood, the assemblies are loaded in the download assembly cache and started only from there if the timestamp on the server did not change. It does what it should do on my computer. Can anyone help me with any idea?
Thanks,
Roland.
|
|
|
|
|
Hi there,
You may try to delete the download folder in the assembly cache:
gacutil /cdl
Next time, when you run the application, the lastest version will get downloaded.
|
|
|
|
|
Hi!
The client PCs have only framework installed, not the SDK. So, gacutil is not available. I tried to delete the physical download assembly cache folder (..local settings\assembly\dl2) - which is exactly what gacutil /cdl does - but can't find it under Win98. It must be in a different folder or have a different name.
Nevertheless - thanks for the reply,
Roland.
|
|
|
|
|
In this case, I am thinking of putting the main code of the application in a seperate assembly, say MainApp.dll, and the application .exe now works as a wrapper which is responsible for loading the main assembly from the web server with the help of the Assembly.LoadFrom[^] method. Every time the application runs, the main assembly MainApp.dll gets downloaded with the latest version.
|
|
|
|
|
I want to write such a script that will allow user having browser, just click the link and my software will be downloaded and installed at their machin.....
If u plz help...
I want this done without asking user where to download and after download click for install....
|
|
|
|
|
an anchor tag. Then the user can click run when it downloads, or check to automatically run on download.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi thanx...
but I want the process to be automated like...
the s/w will be downloaded at predefined location on user m/c and he/she will noe be required to click for install it.
the process will start as soon as download will complete.
Thanx again..
|
|
|
|
|
That would be what we call a virus. I guarentee that if this can be done with older versions of IE, the latest ones will do all they can to stop it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Is there any way I install my software in intranet just giving the IP address of any machine where I want to install it. But there(on remote m/c) won't be any client programm running.
|
|
|
|
|
using System.VirusServices;
You can't do that without the user's permission.
WM.
What about weapons of mass-construction?
|
|
|
|
|
can some body help me with this code below i am trying to use javascript to redirect to my next webform but it will not work and i am not sure what is wrong with it
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="Webx.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="WebForm1" name="webform1" method="post" runat="server">
<INPUT name="submit1" id="submit1" style="Z-INDEX: 101; LEFT: 95px; POSITION: absolute; TOP: 312px" type="submit" onclick="movenext()" value="Submit">
</form>
<script language="javascript">
function movenext()
{
window.location="webform2.aspx";
}
</script>
</body>
</HTML>
thanks,
chad
|
|
|
|
|
Standard question #1:
What do you mean by "not working"?
Standard question #2:
What error message do you get?
---
b { font-weight: normal; }
|
|
|
|
|
i think i figured it out i was using a submit button and when i clicked it it just stayed on the same page but i have switched to a button and it seems to be working fine now
thanks
chad
|
|
|
|
|