将数据插入数据库时​​出现问题 [英] Problem in inserting data to database

查看:96
本文介绍了将数据插入数据库时​​出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

实际上是带有一些字段的表单,用户可以在其中输入一些数据.
输入的数据将在提交时传递到另一个ASP文件中,该文件将插入数据库中.尽管它显示为已更新,但是它没有存储在数据库中..

Actually am having a form with some fields, where user can enter some data.
Entered data will be passed to another asp file on submitting, where am inserting into a database. Though it is showing updated, it is not stored in database..

<%@ Language=VBScript %>
<% Response.Buffer = true %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<form action = "" method = "post">
<%
Dim rs
        set rs = Server.CreateObject ("ADODB.Recordset")
        rs.CursorType = 2
        rs.LockType   = 3
        rs.Open "details", "DSN=Personal" 'adOpenKeyset,adLockOptimistic
        rs.AddNew
        rs("Name")          = Request.Form ("name")
        rs("Family_Income") = Request.Form ("income")
        rs("Gender")        = Request.Form ("gender")
        rs("DOB")           = Request.Form ("dob")
        rs("Guardian")      = Request.Form ("guardian")
        rs("Height")        = Request.Form ("height")
        rs("Occupation")    = Request.Form ("occupation")
        rs("Color")         = Request.Form ("color")
        rs("Caste")         = Request.Form ("caste")
        rs.Update
        rs.Close
        set rs= nothing
        Response.write("Updated")

%>

<P>&nbsp;</P>
</form>
</BODY>
</HTML>

推荐答案

请参阅此页面.

http://www.w3schools.com/ado/ado_add.asp [
See this page.

http://www.w3schools.com/ado/ado_add.asp[^]


您是否正在将adovbs.inc用于ADO连接与否?请使用此文件.您可以从网络搜索中下载任何文件.
Are you using adovbs.inc for ADO connection or not? Please use this file. You can download it any from searching in web.


这篇关于将数据插入数据库时​​出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆