用表单来提交sql(转)3

生活那么的不易

生活那么的不易

2016-01-29 19:46

用表单来提交sql(转)3,用表单来提交sql(转)3
列表 D: buildSQLInsert函数的最终版。


<%
function buildSQLInsert( targetTable, omitFields)
         iStr = "insert into " & targetTable & " "
         vStr = "values ("
         nStr = "("
          在表单集合中循环,并建立起SQL语句的组成部分
         for each x in request.form
                  fieldName = uCase(x)
                   判断字段是否被省略?
                  if inStr(uCase(omitFields),x) = 0 then
                       fieldData = replace(request.form(fieldName), _
                                "", "")
                        如果没有数据,就插入 NULL
                       if trim(fieldData) = "" then
                                fieldData = "NULL"
                                vStr = vStr & fieldData & ", "
                                nStr = nStr & fieldName & ", "
                       else
                                typeDelimPos = inStr(fieldName, "_")
                                if typeDelimPos = 0 then
                                      是文本字段
                                      建立字段名列表
                                     nStr = nStr & fieldName & ", "
                              
展开更多 50%)
分享

猜你喜欢

用表单来提交sql(转)3

ASP
用表单来提交sql(转)3

用表单来提交sql(转)2

ASP
用表单来提交sql(转)2

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

用表单来提交sql(转)1

ASP
用表单来提交sql(转)1

用表单来提交sql - 3

ASP
用表单来提交sql - 3

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

用表单来提交sql - 1

ASP
用表单来提交sql - 1

用表单来提交sql - 2

ASP
用表单来提交sql - 2

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

浅析COM的思想及原理(1)

浅析COM的思想及原理(1)

Photoshop CS3实例教程:创建与Flash整合的flv视频

Photoshop CS3实例教程:创建与Flash整合的flv视频
下拉加载更多内容 ↓