HOW TO ADD RECORD to database from ASP using jscript external file
HOW TO ADD RECORD to database from ASP using jscript external file
ASP-VBSCRIPT man ako gamit...
asp-javascript ka bai?
yeah! bling bling men...abz'
asp-vbscript is good if ur using IE unfortunately im using FF and vbscript is not recognize by this browser...
i used asp-jscript (not javascript) for dbase manipulation/updates infact i have 2 things to ask:
HOW TO:
1. call a jscript function in ASP
2. perform record insertiion using jscript
i have this code running
<% @LANGUAGE="jscript" %>
<%
//open dns connection
var strcon="DSNName";
ocon=Server.CreateObject("ADODB.Connection");
ocon.Open(strcon);
//run execute command to insert new record
ocon.execute("INSERT INTO tblname(fld1,fld2,...) VALUES(val1,val2,...);");
ocon.close();
%>
now since this code is running as ASP file
im planning to encapsulate the codes to a function and trigger a function call from
other page where is it will execute record insertion. i rewrite the code to this:
<% @LANGUAGE="jscript" %>
<%
function add(){
//open dns connection
var strcon="DSNName";
ocon=Server.CreateObject("ADODB.Connection");
ocon.Open(strcon);
//run execute command to insert new record
ocon.execute("INSERT INTO tblname(fld1,fld2,...) VALUES(val1,val2,...);");
ocon.close();
}
%>
but an error return...
Unsa ma'y error bai?
Suwayi lang ni:
Una gamit sa ka ug #include directive sa page diin imong gamiton ang imong hinimong function.
(ex. ><!--#include file="functions.asp"--> )
Dayon tawagon nimo ang function, kung sa vb kay maggamit man ka ug call nga keyword para matawag nimo ang function (i.e. <% call add() %>) sa jscript kay wala na na cya ang call nga keyword dritso nalang (i.e. <%add(); %>)
Originally Posted by hybrid_X
k na to bai. nag ajax nlang ko
Similar Threads |
|