用表单来提交sql - 3

感受426

感受426

2016-01-29 17:13

用表单来提交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 & ", "
                                     vStr = vStr & "'&
展开更多 50%)
分享

猜你喜欢

用表单来提交sql - 3

ASP
用表单来提交sql - 3

用表单来提交sql(转)3

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

s8lol主宰符文怎么配

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

用表单来提交sql - 1

ASP
用表单来提交sql - 1

用表单来提交sql - 2

ASP
用表单来提交sql - 2

lol偷钱流符文搭配推荐

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

用表单来提交sql(转)2

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

用表单来提交sql(转)1

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

lolAD刺客新符文搭配推荐

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

用密码保护页面 (II)

用密码保护页面 (II)

《侠盗猎车5》战机天煞低速飞行技巧详解

《侠盗猎车5》战机天煞低速飞行技巧详解
下拉加载更多内容 ↓