ASP / SQL空记录集生成空白页面。 [英] ASP/SQL Empty Recordset producing blank page.

查看:67
本文介绍了ASP / SQL空记录集生成空白页面。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

本质上,我有一个asp表单页面,它将自己发布到另一个asp页面进行验证,只要第二页在sql查询中找到一个相等的PO号,一切都很好,如果没有结果SQL表的页面是空白的,我一直试图说如果PO在recorset然后响应写入字段,否则写入响应无效或类似的东西。我显然写错了代码,任何帮助将不胜感激。正如我所说,如果结果集很好,那一切都有效。

展开 | 选择 | Wrap | 行号

解决方案

我也试过这个但同样的事情,如果记录有效,它将显示正确的数据,如果表单字段不是像sql表中的一行那样页面出现空白。

展开 | 选择 | 换行 | 行号


< blockquote>使用RecordCount属性查看返回的记录数。如果它是0,那么你没有得到匹配。


当我输入错误的购买订单号时,我知道我的记录数为0,即问题,我试图确保它不显示空白记录集,我希望它在其位置显示一般错误。我尝试了这个但结果相同,如果有效则显示,但如果无效则显示空白页。

展开 | 选择 | Wrap | 行号


In essence, I have a asp form page that posts itself to another asp page for validation, as long as the second page finds an equal PO number in the sql query, everything works great, if there is not a result in the SQL table the page is blank, I have been trying to say if PO is in recorset then response write the field else write response invalid or something similar. I have obviously written the code wrong, any help would be appreciated. As I said if the resultant set is good, it all works.

Expand|Select|Wrap|Line Numbers

解决方案

I have also tried this but same thing, if the record is valid, it will show the correct data, if the form field is not like a row from the sql table the page comes up blank.

Expand|Select|Wrap|Line Numbers


Use the RecordCount property to see how many records were returned. If it''s 0, then you didn''t get a match.


I know that I am getting a record count of 0 when I type in a wrong purchaseorder number, that is the issue, I am trying to make sure that it does not display the blank recordset, I want it to display a generic error in its place. I tried this but same results, displays if valid but blank page if invalid.

Expand|Select|Wrap|Line Numbers


这篇关于ASP / SQL空记录集生成空白页面。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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