ASP自动插入 [英] ASP automatic Insert

查看:74
本文介绍了ASP自动插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个自动插入。

我有一个包含50多个字段(表单)的ASP页面,我想在SQL Server 2005的表中插入所有这些信息。


现在,我有插入的声明但我需要创建自动插入,因为有时我需要添加新字段或删除一些字段(从HTML表单页面),我我不想在每次添加新字段时修改插入语句


我不知道我是否解释了我的想法。


我真的很感激任何帮助


谢谢

I want an automatic insert.
I''ve an ASP page with more than 50 fields (form) and I want to an insert all that information in a table in SQL server 2005.

Now, I''ve statments for insert BUT I need to create en automatic insert, because sometimes I need to add new fields or remove some fields (from HTML form page), and I dont want to modify the insert statment every time I add a new field

I dont know if I explained my idea.

I really appreciate any help

Thank you

推荐答案

这样做的最好方法是使表单输入名称与db完全相同字段名称。然后,而不是使用插入而不是声明,使用SELECT和addnew:
the best way to do this is to make the form input names exactly like the db field names. Then instead of using an "Insert" statement, use "SELECT" and "addnew":
展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号


现在我想到了,如果有的话,这可能会给你一个错误数据库中的字段不是来自表单(如自动编号),所以你应该说:
Now that I think about it, this might give you an error if there is a field in the db that doesn''t come from the form (like an autonumber), so you should probably say:
展开 | 选择 | Wrap | 行号


非常感谢!!我真的很感谢你的帮助!


NIKO
THANK YOU SO MUCH!! I really appreciate your help guys!

NIKO


这篇关于ASP自动插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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