Click to See Complete Forum and Search --> : Method Problem...


hally
02-22-2006, 06:54 PM
This is my code..

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">


<% @Language="JavaScript" %>

<%
var dsn="dsn=VS";
var Conn=
Server.CreateObject("ADODB.Connection");
Conn.Open(dsn);


var no_vot = Request.Form("novot");
var thn = Request.Form("tahun");
var peruntukanthnn = Request.Form("peruntukan");
var tmbh = Request.Form = ("ptambahan");
var total1 = 0;
total1 = peruntukanthnn + tmbh

var sql = "Insert INTO KE (NOVOT, TAHUN, PERUNTUKAN, ANGGARANT, BUDGET ) VALUES ('"+no_vot+"','"+thn+"','"+peruntukanthnn+"',

'"+tmbh+"','"+total1+"');"

Conn.Execute(sql);
Conn.Close();
Conn=null;

%>


<HTML>

<HEAD>
<TITLE>JUMLAH PERUNTUKAN TAHUNAN</TITLE>
</HEAD>

<link rel="stylesheet" type="text/css" href="images181/blue.css">

<BODY BGCOLOR="#000000">

<CENTER>
<IMG SRC="banner.jpg">
</cENTER>

<BR>
<BR>
<BR>
<BR>
<BR>
<BR>

<FONT face="Verdana,Tahoma" COLOR="white">

<CENTER>
<P>Peruntukan bagi Tahun <%=Request.Form("tahun") %> ialah RM
document.write("" + total1);
</P>
</CENTER>

</FONT>


<FONT face="Verdana,Tahoma" SIZE="3">
<ALIGN="RIGHT">
<BR>
<BR>
<P>
<A HREF="addnew1.asp">seterusnya>>>></A>
</P>
</ALIGN>
</FONT>


<BR>
<BR>
<BR>

<FONT FACE="Verdana, Tahoma" SIZE="-2" COLOR="white">
<br>
<CENTER>Copyright Reserved 2006</a>
</CENTER>
</FONT>



</BODY>
</HTML>


i dont know why i had face this problem...


Error Type:
Microsoft JScript runtime (0x800A01B6)
Object doesn't support this property or method
/SYSTEM VOT/viewperuntukan1.asp, line 16



i just want to store the total sum of "peruntukan" + "ptambahan" ...
"ptambahan" is not a static value.. it can be change by the user... "peruntukan" is a static value...

please help me...it very urgent

Hally form Malaysia...

Gaurav Khanna
02-24-2006, 03:09 AM
try to change the
var tmbh = Request.Form = ("ptambahan"); into
var tmbh = Request.Form("ptambahan");
-------------------------------------------
secondly

var sql = "Insert INTO KE (NOVOT, TAHUN, PERUNTUKAN, ANGGARANT, BUDGET ) VALUES ("& no_vot &","&thn&","&peruntukanthnn&",
"&tmbh&","&total1&");"

-----------------------------------

not like this given below
var sql = "Insert INTO KE (NOVOT, TAHUN, PERUNTUKAN, ANGGARANT, BUDGET ) VALUES ('"+no_vot+"','"+thn+"','"+peruntukanthnn+"',

'"+tmbh+"','"+total1+"');"

hally
02-24-2006, 10:24 PM
ok thank you.. i will try it..

hally
02-26-2006, 07:47 PM
hello i had try from what you had suggest to me.. but i have this problem now.. please help me..


Error Type:
Microsoft JScript compilation (0x800A03F7)
Unterminated string constant
/SYSTEM VOT/viewperuntukan1.asp, line 20, column 119
var sql = "Insert INTO KE (NOVOT, TAHUN, PERUNTUKAN, ANGGARANT, BUDGET) VALUES ("&no_vot &","&thn&","&peruntukanthnn&",
----------------------------------------------------------------------------------------------------------------------^


please.. i really-really need help...

Hally student from Malaysia

Gaurav Khanna
02-27-2006, 12:49 AM
Hi i dont know what datatypes u r using with the columns but in case if u using char datatype then specify '"& peruntukanthnn &"' instead of "& peruntukanthnn &"

and if your column is having int datatype then use "& peruntukanthnn &" .

Do one more thing mention details of columns datatypes.

hally
02-27-2006, 06:12 PM
hi Gaurav.. all my data type for table ( KE ) are :


NOVOT- text
TAHUN - text
PERUNTUKAN- Currency
ANGGARANT-Currency
BUDGET -Currency


thank you and please help me.. mybe u can give me some suggestion for me to solve this problem.. thanks

Hally student from Malaysia...

Gaurav Khanna
02-28-2006, 05:10 AM
i think u must try using datatype number or int instead of currency datatype.

or do one more thing email me u r database and asp in gauravkhanna28@yahoo.com id i will try in my system and send u with u r solution.