Determine If More Than One Row Returned
I have an ASP/ADO application querying an SQL Server DB. I want know the most efficient way to determine if more than one row is returned from a query. If more than one row is returned, the user will be presented with a choice of which row to process. If only one row is returned, I want to skip this stage, and process that single row immediately.
I can think of a number of ways of acheiving this (eg. .recordcount) but I'm looking for the slickest and most efficient method.
View Replies
ADVERTISEMENT
How is it possible to execute an exe from asp and get a returned string (no http headers in exe) ?
To run exe I use :
<%
cmdExe = sPath & "cgi-bin
equest.exe"
Set WshShell = Server.CreateObject("WScript.Shell")
sResult = WshShell.Run(cmdExe, 1, True)
Set WshShell = Nothing
Response.write sResult
%>
sResult always content "0" and not the string returned by exe file (something like "!!-1!blabla!blablablabla!")
- How is it possible to get the exe returned value ?
- Is there a solution with asp.net ?
View Replies
View Related
When I do a query that I know has 2 rows, I get rs.recordcount equals -1. Same thing when it's just one row. I need something that gives me the number of rows.
View Replies
View Related
I am trying to update a record but it returns this error :
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'Function'.
/performaindia/security/functionssys.asp, line 210
Now at line 210, I have this function :
rs.Update.
View Replies
View Related
I am getting this error on selecting an option :
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column 'SystemUserOnly', table 'performaindia.dbo.SecurityTableFields'; column does not allow nulls. INSERT fails.
/performaindia/security/tablefields.asp, line 220
now the line 220 is an update statement :
rs.Update
View Replies
View Related
I have a bit of a situation here, I own a job board and have multi-posting comapnies posting jobs to our database and we have returned values going back to them to tell them if the job vacancy was posted succesfully or not.
The problem I have is that our main ASP guru is of sick and the other is off away on business. I have pretty good knowledge of ASP but not as much as these guys. So I need to know how to send a response back to the posting company whether it has been succesfull in posting the job vacancy instead of sending back a page back displaying whether it was successful.
View Replies
View Related
I define a recordset with a pagesize of 100 in my COM object and return this recordset to ASP. When I check my pagesize at the ASP level,it is 10 I assume this is the default.
I can set my pagesize at the ASP level after the COM function is called, but I would prefer to have this encapsulated within the COM.
View Replies
View Related
I am not sure what way to do this, i want a specific row returned and displayed in asp but not in a text box, in acess and vb i ahve done this and its just a label but not sure in asp.
View Replies
View Related
I have a simple VBS to return some unless data (as a test) and it works correctly. Code:
View Replies
View Related
here is some background on the page I made. It's a calendar page with events listed. No database, just used id="" to display certain months depending on the option chosen from the jump down menu.
The question I have is this: I would like to display the current month's events when they land on the page. I used
<%
id=request.querystring("id")
%>
and created an <%elseif id="1" then%> and so on for each month. Is there a way can request the month and display that id? Thanks for you help. I have the code for the page if need be
View Replies
View Related
wondering if its possible to have some kind of searched word highlight! IE. every thing it throws up in return of search it will highlight why it has brought it up! so if search "a" all "a" in return results would be highlighted.
View Replies
View Related
I've got a DropDownlist with predefined numbers(5,10,15,20 etc.) which I
want to do a postback to the GridView pagesize, so that the user manually can
change returned rows. Is there a way to do that in the properties of the
Designview or must there be a code behind. If so, what is the code for this?
View Replies
View Related
I am retrieving a response from another site but certain special characters such as ' (single quote) or "(double quote) and £ (pound sign are being returned as ?. The code i am using to get the page is as follows:
Set objhttp= Server.createObject("Microsoft.XMLHTTP")
objhttp.open "POST","http://www.mysite.co.uk/viewdetails-" & PrmRef & ".rsp",false
' objhttp.setrequestheader "Content-Type","text/plain"
' objhttp.setrequestheader "Accept-Charset","iso-8859-1"
' objhttp.setrequestheader "content-type","text/html","charset","iso-8859-1","application/x-www-form-urlencoded"
' objhttp.setrequestheader "content-type","text/html"
' objhttp.setrequestheader "Content-Type","application/x-www-form-urlencoded"
objhttp.send formData
prmResp = objhttp.responseText
I have tried setting various values for the requestheader as commented out above but with no success.
View Replies
View Related
I'm currently developing on IIS 5, ASP 3 and MySQL 4.1 using the latest ODBC driver from MySQL.
Any time field I have return from the database is returned as the current date. I've tried every table which has a date, created tables which soley keep records on the date.
I've submitted the date from MySQL Query browser using CURRENT_TIME and from an ASP page. Both submit fine.
I've returned the record using a Recordset to move through each and filled an array using GetRows().
View Replies
View Related
short n simple question: I want to display the number of records returned from a search. Code fragment as follows:
// d/b retrieval SQL code
SQLCode = SQLCode
Set objRS = objConn.Execute (SQLCode)
// displaying the returned results
Do While (Not objRS.EOF
<< spit out records >>
objRS.MoveNext
Loop
Now, is there an instance of objRS I can call that will just display how many records were returned? I tried objRS.Count on a longshot, but that didn't work
View Replies
View Related
I have an ASP report that returns values from a SQL database and
formats the data in an HTML table.
I am trying to figure out a good way of using CSS to highlight the
table row that contains the highest value returned.
I tried storing the values in an array, and then used a function to
find the highest value. This worked, but then I couldn't really
figure out how to "tell" the report to highlight that highest value.
Could anyone think of an easier way?
View Replies
View Related
I need to be able to do a search (postcode) from a list of around 2500 addresses. I would like to create a temp table and for the returned recordset to be in a random order, until that is the user requests to sort by say Name, Address etc...
The order initially needs to be random because I do not want the same 'top' addresses appearing for the same postcodes...
I thought I could in the temp table assign a sort order column and then place a random number in it. If I choose a large random number range then the likelihood that the same record has the same number is low...
View Replies
View Related
i have an asp page which creates a object using server.createobject and uses its method.i get some garbage value.
example:
set obj1= server.createobject("test.test") ' test is a dll
tmp = obj1.method() ' it returns a BSTR string.
i want to display tmp in HTML. when i tried to print tmp like
<font><%=tmp%></font>
View Replies
View Related
I have created a simple search engine which retrieves records from an access database using sql and displays them using ASP.How do I go about counting the number of records that have been retrieved?
View Replies
View Related
why a ADO recordset.recordcount would return a -1? I have confirmed that it has records in it by writing some values to the screen. Why can't I count the number of records returned though?
View Replies
View Related
I have this on my asp page SELECT * FROM company WHERE comName LIKE '*Tech*' If I run it against Access then it returns a few records but within my ASP page, no record is returned. Why and how to fix it?
View Replies
View Related
I have been using the following code to count the number of rows returned from a query:
Alldata = rs.Getrows()
NumRows = Ubound(Alldata, 2)
The problem is I am now having to limit the number of rows that it returns:
Alldata = rs.Getrows(300)
Now my NumRows always equals 300 no matter how many matches are found so my counter doesn't work. Does anyone know a way around this?I know that I can use SELECT COUNT(*)..... instead in an SQL query but that means making two trips to the server which I don't really want to do.
View Replies
View Related
I am looking for a simple way to limit the amount of letters/Characters returned so that it does not throw off my pages styling. Basically I have the following: Code:
<%
Dim SomeVariable
response.write(SomeVariable)
%>
If that SomeVariable has 300 characters in it it will create a very large table that it displays in so, what I want to do is limit it to say 25 or 50 Characters and simply put like .... after it. Any Ideas?
View Replies
View Related
Is it possible to have a print button on a queried page to print just the table returned?
View Replies
View Related
Please help me in finding the code for reading the Return parameter value from an Oracle stored procedure through an ASP page. I need a javascript code for doing that.
Please friends it would be of great help if i get the exact code since my project is stuck up bcoz of this.
View Replies
View Related
Is there a way to determine the actual width and height of a image file ?
I'm using aspsmartupload to upload the image, how can determine and save the
width and height value ?
seems that aspsmartupload doesn't have this property.
If so, is there any method to determine it in asp in the simpliest way? I
will prefer to maintain the aspsmartupload method.
View Replies
View Related
I have many servers which will be reghosted everyday with different OS
(Win2000, Win2003, WinXP...). How could I write the ASP code to get the
information of other servers' OS?
Let say the asp page is hosted on Server A, how can I check the OS version
of Server B and Server C?
View Replies
View Related
How do you determine if a given date is a weekday (Mon-Thurs) or weekend (Fri - Sun)? Is there a built in function?
View Replies
View Related
Somewhere in my program I ask users to provide their website URL. I would like to determine if the given website exists or not.How can I determine a website with given URL exists?
View Replies
View Related
I am creating an ASP page for members of my team to add and delete records from specified tables. This table is choose by the user and I am dynamically creating text boxes. I also wish to include the type of the attribute to assist the user.
<%
for s_intCounter=0 to objRs.Fields.Count -1
%><tr>
<td width="34%"><% objRs.Fields.Item(s_intCounter) %>: <input type="text" id = <% objRs.Fields.Item(s_intCounter) %> > </td>
<td width="66%">Type: <% INSERT ASP FOR RETRIVING TYPE</td>
</tr>
<%next%>
View Replies
View Related
I want to use asp to assign a css class to <td> tag. I was thinking an If statement, but i've not come across trying to assign a class to a table cell before! I want the cell background to be highlighted red determined by a database table with - yes or null. (null remains white, yes - red) At the moment it simple like this: Code:
<td><%=strAddress%> </td>
View Replies
View Related
My web hosting account lets me use ASP and so I thought I'd try to learn and use some.
There is only one thing that I would like to know, and that is how to find out what version of ASP is running. Preferably, what I am looking for is something similar to the PHP php_info() function. Is there anything like this for ASP?
View Replies
View Related
This may be a trivial question, but I was wondering how can you determine if a value contains an Integer or Float. I know there is a function called IsNumeric, however you can't determine what type it is.
View Replies
View Related