|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
Split 程序代码 <%attribs="商场名^^快餐店名^^报停名" names=Split(attribs,"^^") i=0 for each name in names response.write names(i)&"<br>" i=i+1 next%> 程序拆分结果: 商场名 快餐店名 报停名 根据 Split 结果生成 SQL 语句 <%attribs="商场名^^快餐店名^^报停名" names=Split(attribs,"^^") i=0 sql="select top 10 * from TableName where" for each name in names if names(i)="商场名" then sql=sql+" or 商场 like \\\'%"&names(i)&"%\\\'" end if if names(i)="快餐店名" then sql=sql+" or 快餐店 like \\\'%"&names(i)&"%\\\'" end if if names(i)="报停名" then sql=sql+" or 快餐店 like \\\'%"&names(i)&"%\\\'" end if i=i+1 next sql=sql+" Ordey by Id DESC" sql=Replace(sql, "where or", "where") response.write sql%> 程序运行结果: select top 10 * from TableName where 商场 like \\\'%商场名%\\\' or 快餐店 like \\\'%快餐店名%\\\' or 快餐店 like \\\'%报停名%\\\' Ordey by Id DESC 返回类别: 教程 上一教程: 操作INI文件的COM 下一教程: 实现E-MAIL地址验证的VBS函数代码 您可以阅读与"ASP中巧用SPLIT()函数生成SQL查询语句"相关的教程: · 在ASP中使用SQL语句之2:用WHERE子句设置查询条件 · 在ASP中使用SQL语句之6:存储查询 · 在ASP中使用SQL语句之10:视图 · 在ASP中使用SQL语句之9:表单操作 · SQL语法及ASP中SQL语句参考及记录集对象 |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |