By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,180 Members | 1,202 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,180 IT Pros & Developers. It's quick & easy.

Data from Form does not appear in access database

100+
P: 145
Hi, anyone can help me?

My problem is data from Form of Asp does not appear in access database when i open the database. Why does this happen?

My table name:Cuba
Expand|Select|Wrap|Line Numbers
  1. ID      PK
  2. Nama 
  3. Umur
  4.  
  5.  
my asp code:
Expand|Select|Wrap|Line Numbers
  1. <%@language="Javascript"%>
  2. <html>
  3.  
  4. <body>
  5. <%
  6.     var DSN ="C:/Inetpub/wwwroot/cubatry.mdb"
  7.     var Conn = Server.CreateObject("ADODB.Connection");
  8.     Conn.Provider = "Microsoft.Jet.OLEDB.4.0"
  9.     Conn.Open(DSN);
  10.  
  11.     if(Request("btnSubmit") == "submit")
  12. {
  13.  
  14.     var TryID = Request.Form("txtID")
  15.     var TryName = Request.Form("txtName")
  16.     var TryUmur = Request.Form("txtUmur")
  17.  
  18. sql2="INSERT INTO Cuba lagi (ID, nama, umur) VALUES ('"+TryID+"','"+TryName+"','"+TryUmur+"')";
  19. Conn.Execute(sql2);
  20.  
  21. Conn.Close()
  22. Conn = null
  23. }
  24. %>
  25.  
  26. <form name="cubaform" action="" method="post">
  27. Nama:<input type="text" name="txtName" /><p>
  28. Umur:<input type="text" name="txtUmur" /><p>
  29. ID:<input type="text" name="txtID"  /><p>
  30.  
  31. <input type="submit" value="submit" name="btnSubmit"/>
  32.  
  33. </form>
  34. </body>
  35. </html>
  36.  
  37.  
I already check the odbc conection and i believe i do it correctly...I have check several time the code.Help from anyone would be aprreciated.
May 24 '10 #1
Share this Question
Share on Google+
2 Replies


jhardman
Expert 2.5K+
P: 3,405
Are there any error messages? Can you successfully query the db using this method?

Jared
May 25 '10 #2

100+
P: 145
Thank you i already figure it out.
May 26 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.