User Profile
Collapse
-
Cool on not needing the Else clause. If I am writing a lot of HTML I do end my asp code instead of using response.write, sometimes if it is just one line it is easier just to escape it out. Thanks for your input. -
Disregard, I had an extra line of code from troubleshooting , this worked great, thank you....Leave a comment:
-
This seems to create two input boxes then, first a blank one and then one populated with 'test'. Am I using the if statement incorrectly?
Code:if oRs.eof then Response.Write "<td align=""center""><input type=""text"" id=""ows1nox"" value= 'test' name=""ows1nox"" class=""inputtext1""/></td>"
Leave a comment:
-
If then statement if record exists
So this code works great as long as there is a record otherwise it is just blank, I have tried several if then statements but I can't seem to make it work. How can I if then this statement?:
Code:<% Set oRs=Server.CreateObject("adodb.recordset") strSQL = "SELECT TOP 1 tag, time, round(value, 3) as value FROM pi.piarchive..picomp2 where tag = 'C4_4AQ10P01' and time > DATEADD(DAY, -15, GETDATE())
-
-
If I do it twice, it just posts both responses even if just one of the fields is blank. It seems like there would have to be a way to see the difference between the two fields in the select statement, otherwise, doesn't the recordset.eof just check to see if any records exist, not which part of the sql is causing it to produce no records? I thought you were saying to just write the recordset.eof statement twice?
Code:if recordset.eof
Leave a comment:
-
Sorry, I am not usually this needy but could you give me an example for one of the separate queries, this is literally the last step and I will be done with this site. Thanks.Leave a comment:
-
Good question, stupid mistake, I pasted from what I was trying on a test site, sorry. It does look like it works with my original sql statement which makes it much easier.
The only real issue is that if any of the records fails it responds with the Else response, is there a way to make it so you know which field failed? For example, whether or not it was the employee number or the purchaseorder number that is invalid? That is why...Leave a comment:
-
So now it errors out with:
Microsoft OLE DB Provider for SQL Server
error '80040e14'
An expression of non-boolean type specified in a context where a condition is expected, near 'else'.
/data_entry/safety/safety_t.asp, line 63
I have looked this up but this should not be doing an update or insert at this point.
The code is as follows:
...Leave a comment:
-
Would I add that before or inside the:
Code:Do while Not recordset.eof
Leave a comment:
-
Error in the query statement in itself.
I believe the real problem is that since the query is not pulling up a good record then it stops processing the page. Is there a way to say if the result set in the sql query produces a good result then process rest of page, if not go to a different page?
Code:sSQL="SELECT * FROM [database].[dbo].[table1],[database].[dbo].[table2] where GF3_EKKO_EBELN like '%" &
Leave a comment:
-
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.
Code:<% If InStr(Recordset.Fields("GF3_EKKO_EBELN"), purchaseorder)>0 Then Response.Write
Leave a comment:
-
Additional if then attempt
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.
Code:<% If InStr(Recordset.Fields("GF3_EKKO_EBELN"), purchaseorder)<0 Then Response.Write "<td align=""left""><span class=""style8"">YOUR
Leave a comment:
-
ASP/SQL Empty Recordset producing blank page.
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...
No activity results to display
Show More
Leave a comment: