Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2004
    Posts
    21

    Unanswered: how to insert data?

    i've got problem...i am developing web-based system using asp javascript and ms access...i cannot save data from form into database...what is the scripts in order to this process?? on my form, i have textfields uid,pwd and level(hidden)...i am using DSN-Less connection...

    i have tried using DSN connection but there is a problem on the Execute command...

    help me please...

  2. #2
    Join Date
    Sep 2004
    Posts
    21
    <%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
    <%
    var Conn = Server.CreateObject("ADODB.Connection");
    var DSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("/Zakat/zakat.mdb");
    Conn.Open(DSN);
    //var RS = Server.CreateObject("ADODB.Recordset");

    var uid;
    var pwd;
    var pwd2;
    var level;
    var sql;


    if (Request.Form("uid") > ""){
    uid = Request.Form("uid");
    pwd = Request.Form("pwd");
    level = Request.Form("level");}
    else{
    Response.Redirect("daftar_user.asp");}

    if (Request.Form("uid") > ""){
    sql = "Insert INTO users (uid,pwd,level) Values ('" + uid + "','" + pwd + "','" + level + "')";
    Conn.Execute(sql);
    Conn.Close();
    Response.Redirect ("menu_user.asp");}
    %>


    above is my scripts and the highlighted one is where the error found

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •