Print Page | Close Window

whats wrong in this script ??

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=3577
Printed Date: 28 March 2026 at 3:40am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: whats wrong in this script ??
Posted By: aero
Subject: whats wrong in this script ??
Date Posted: 16 June 2003 at 10:34am

see this site http://www.javacoder.dk:56400/fileupload/sizecount2.asp - http://www.javacoder.dk:56400/fileupload/sizecount2.asp

I have 3 sites and 1 database in the database I have a tabel FilStr

On my sizecount.asp
<%
Dim aUnits, nUnit
aUnits = Array("B", "kB", "MB", "GB", "TB")
nUnit = 0
Do Until (nSize <= 1024) OR (nUnit = UBound(aUnits))
  nSize = nSize / 1024
  nUnit = nUnit + 1
Loop
FormatSize = FormatNumber(nSize, 2) & " " & aUnits(nUnit)
End Function
%>

This site will give me a right sizetype !!!


my db.asp
<%
Dim sConnectionString, oConnection, oRecordset, intTotalSize
sConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath ("FileDB.mdb")
Set oConnection = Server.CreateObject("ADODB.Connection")
oConnection.Open sConnectionString
Set oRecordset = Server.CreateObject("ADODB.Recordset")
oRecordset.Open "SELECT Sum([FilStr]) FROM [files]", oConnection, 1, 1
intTotalSize = FormatSize(oRecordset.Fields(0).Value)
oRecordset.Close
Set oRecordset = Nothing
%>

This site will give me a sum of all the numbers in FilStr !!


My Sizecount2.asp site:
<!-- #include file="db.asp" -->
<!-- #INCLUDE FILE="sizecount.asp" -->
<html>
<head>
<body>
<%
Response.Write "<b><font face=Tahoma size=2>" & FormatSize(intTotalSize) & "</font></b><font face=Tahoma size=2>&nbsp;Total Filesize</font><br>"
%>
</body>
</head>
</html>

This site shut show me a file size number !!

but i get an error can someone help me to make this script working !??




Replies:
Posted By: MorningZ
Date Posted: 16 June 2003 at 1:45pm

"i get an error"

and the error would be?



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: aero
Date Posted: 16 June 2003 at 4:02pm

tjek the link !!

but it's something about the End Function code



Posted By: Gullanian
Date Posted: 16 June 2003 at 4:15pm
On the first chunk of code you have an End Function, but wheres the start of it?


Posted By: aero
Date Posted: 17 June 2003 at 1:42pm

MorningZ or Gullanian

Will U help me to get the code right so it will work ?? Pleas !!!



Posted By: michael
Date Posted: 17 June 2003 at 2:05pm
As it appears to be a function (the top script) there is the declaration of the function missing. Try something like
<%
Function (nSize)
Dim aUnits, nUnit
aUnits = Array("B", "kB", "MB", "GB", "TB")
nUnit = 0
Do Until (nSize <= 1024) OR (nUnit = UBound(aUnits))
  nSize = nSize / 1024
  nUnit = nUnit + 1
Loop
FormatSize = FormatNumber(nSize, 2) & " " & aUnits(nUnit)
End Function
%>
I used nsize as it was the only value not dimmed so might not be right, see where you got the script from, what is missing.


-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: aero
Date Posted: 17 June 2003 at 2:31pm

then I get a new error !!!

try to se the link !!



Posted By: michael
Date Posted: 17 June 2003 at 2:37pm
I see the link but do not speak your language. Put some effort in it.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: MorningZ
Date Posted: 17 June 2003 at 2:43pm

o c'mon now Michael...

you ask so much!! lol



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: aero
Date Posted: 17 June 2003 at 2:45pm

ohhh  is it showing the text in Danish !!!

damm

okay

Fejltype:
Der opstod en Microsoft VBScript-kompileringsfejl (0x800A03F2)
Id var ventet
/fileupload/sizecount.asp, line 11, column 9
Function (nSize)
--------^

Errortype:
There was a Microsoft VBScript-compilingserror (0x800A03F2)
Id was expectet
/fileupload/sizecount.asp line 11, column 9
Function (nSize)



Posted By: michael
Date Posted: 17 June 2003 at 3:29pm

aero, if you copy a script from somewhere make sure you copy it right. How could I guess how the function is declared, it was just a wild guess. Go back to the source and get the function completely, if you wrote it yourself (which I doubt) you should know what is going on....

 



-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: aero
Date Posted: 17 June 2003 at 3:54pm

the source is im my head !!!   i have taken som small pices from 10 scripts and make 1 out of them !!!!

But okay I have now deletet the End function !!!! and is getting a new error can U see the problem in this !???



Posted By: michael
Date Posted: 17 June 2003 at 5:29pm
stop doing that, post the error here, first I can't speak danish second I don't feel like going to your side all the time.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: the boss
Date Posted: 17 June 2003 at 6:26pm
so u mean u collected shunks from 10 different places and then cobined them into one..that feels likes assembling a car from junk yard.. hehehe



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net