Display Total Records From Command Object
i'm using command object like this:
objCommand.CommandText = strSQL
strSQL being a SELECT string.
then executing it:
Set rsRec = objCommand.Execute
how can i get total number of records found, changing the line above to this:
Set rsRec = objCommand.Execute totRec
gives me an error and doing just this:
totRec = rsRec.RecordCount ....outputs -1
View Replies
ADVERTISEMENT
I'm trying to display records from an MS Access DB (*.mdb) in an ASP page (table).. I don't want to display all the records though, I just want to display the total of these records..i.e in my table I would like to show how many calls someone has closed this year..(number)
Joe Bloggs ---> 100 Closed
Is this possible? I was thinking that I need to write an ADO that includes COUNT but I'm not too sure how to write this.. Here's what I have so far: Code:
View Replies
View Related
I am getting the above error when trying to execute the following code:
View Replies
View Related
I have an online application. I get the following error when a user selects an option from one drop down list but doesn't select an option from another drop down list. Here is the error:
Microsoft OLE DB Provider for SQL Server error '80040e0c' Command Text was not set for the command object. Code:
View Replies
View Related
I have an online application. I get the following error when a user selects an option from one drop down list but doesn't select an option from another drop down list. Here is the error:
Microsoft OLE DB Provider for SQL Server error '80040e0c'
Command Text was not set for the command object.
Line 87
Line 87 = rs1 = conn.execute(finalSQL)
Here is the page causing the error. Code:
View Replies
View Related
I keep getting this error. I searched the forums, and found one. It said to basically replace elseif with else. It worked for that person.
I tried it and it didn't work. So what i decided to do was, remove all of the if statements and keep one. Even with just one if statement i get the same problem. Does anybody know what is wrong? It worked fine, up until i added the if statement. I need them there though for a reason.
Personally i think, it;s not getting the value from the request form, and hense it isn't picking anything up. What do you lot reckon? Code:
View Replies
View Related
i have some problem in showing data. I have two tables . First table(containing Hosting categories). Second table(Containg catagories data like l,keyword,description.....etc). I want to display catgories names from first table and then diffrent catagories total records from second table, like this
ASP.NETHosting(10)
Linux Hosting(20)
Windows hosting(13)
:
:
:
etc
View Replies
View Related
how can i get a total number of filtered records? what's the code?
View Replies
View Related
i have a small issue with displaying total
heres what i need to do
if its 11 * 7 =77
i need to print 77.00
if its 7.95 * 3 =23.85 then its right
so when its whole number i want to put a .00
is this possible
here is my code for it
Code:
View Replies
View Related
i have some problem in showing data. I have two tables
First table(containing Hosting categories)
Second table(Containg catagories data lik
url,keyword,description.....etc)
I want to display catgories names from first table and then diffrent catagories
total records from second table, like this
ASP.NETHosting(10)
Linux Hosting(20)
Windows hosting(13)
View Replies
View Related
I have y pic's on the server and each time someone visits the site I want to display x of them randomly.
View Replies
View Related
I want to open a recordset object on an .asp page. When I open the recordset I would like to use a stored procedure that expects a parameter to be passed for the stored procedure. I will then use the recordset to loop thru the recordset, update values from the recordset and then update the database by passing parmeters to another stored procedure.
I would like to use the recordset object but can it be used to pass a parameter to a stored procedure? Do I need to use a command object to open the records instead in
order to pass the parameter to a stored procedure?
View Replies
View Related
i build my sql string by using bunch of if-end if statements, after storing the whole SQL string into variable strSQL i put into the command object's CommandText property like so:
objCommand.CommandText = strSQL
Set rsRec = objCommand.Execute 'rsRec being a recordset
then i want to be able to display the data:
While Not rsRec.EOF
Response.Write(rsRec("FIRST_NAME") & " " & rsRec("LAST_NAME") & " - " & rsRec("FIRM_NAME") & _
" " & rsRec("EMAIL") & " " & rsRec("CITY") & "<BR>")
rsRec.MoveNext
Wend
but this gives me an error saying:
Object doesn't support this property or method: 'CommandText'
View Replies
View Related
i keep on getting it for some reason. i am using asp Command text was not set for the command object.
View Replies
View Related
I have a recordset object generated by the command object
as in recordset object=command.execute
now recordset.recordcount gives me -1 !!!!
the actual record count is 7!!!
Any body who can tell em how to change the cursor type of the recordset
which is generated by a command object!!!
View Replies
View Related
i m retriving values from SQL Server 7 using command object through a query
Statement in bold format is giving an error in execution : Code:
View Replies
View Related
Microsoft advises not to pass parameters to the Command object in the Execute statement. Why?
View Replies
View Related
I am trying to close a command object after executing a command text and getting an error message as:
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'close' /data_usage_guide/workplansystem/ProjDataLoad.asp, line 67
The reason I want to close the object is to use it again for executing another commnad text as shown in the code below. Could any oen help why I am getting this error message and/or is there a better way to do this , i.e. posting data to several diferent tables one after the other. Code:
View Replies
View Related
Have no problem getting my select queries to work using this method:
strSQL = "SELECT tblUI.IPAdd FROM tblUI WHERE (tblUI.IPAdd =?)"
arSPrm = Array(strRemHst)
Set rst = cmd.Execute(,arSPrm)
Can anyone point me to some examples of using this method for UPDATE and
INSERT queries? Can't seem to get it to work no matter what I can think of
to try. (If it is possible?)
View Replies
View Related
I am trying to write out the results to the screen and save them to disk, but I can't figure out how to properly formulate the code.
I keep getting this error: Object doesn't support this property or method
Code:
View Replies
View Related
three records into three table cells and then starting a new row for the next
three records.(I've used While not EOF and MoveNext for writing each new record to a new
row
View Replies
View Related
I'm trying to perform a loop to display the contents of my DB, the only issue is that I would only like to display 10 results maximum this is relatively easy but what happens if there are less than 10 results in the DB. If I was going to do a :
Do Until objRS.EOF
Then it would display the full records, likewise if i put a counter on the loop then it will run into errors if I have less records than the count.
View Replies
View Related
I have data base which I ctreated for it a Query to display every Username have same LastName.so this is what I did.I created Query to display to me every Username which have same Lastname For example lastname "Admin"
message for Admin's : why I can't add images.
so I got
Query Table : display all the the username which have the lastname Admin.so how can I display the records from the Query to my ASP page ?
View Replies
View Related
How do you do a select where you only want the last 5 records from Column1?
SQL="Select column1,column2,column3 from Table1"
View Replies
View Related
I have a page displaying records in a table across but there are too many records to display and they run off the page, SO I thought I could show five columns with an unlimited number of rows. I'm stuck though. I've never done that before. I don't know where to start. I don't need paging as I can display all records on one page, keeping it
simple. Here's my recordset:
<%set rsAll=objConn.execute("select * from qyProd where catalogid>0
order by designer_name")%> ...
View Replies
View Related
Maybe I'm just having a brain freeze, but I'd appreciate some help with this. I have a code that goes something like this (simplified):
Code:
for iUser = 0 to dOnlineUsers.Count - 1
sKey = aSessions(iUser)
sUserInfo = dOnlineUsers.Item(sKey)
aUserInfo = split(sUserInfo, "<|>")
sUserName = aUserInfo(0)
sLastActionTime = aUserInfo(1)
sLastPageViewed = aUserInfo(2)
sLastPageURL = aUserInfo(3)
'Since not all pages viewed are product pages
If instr(sLastPageURL, "product.asp") then
Response.Write sLastPageViewed
end if
next
View Replies
View Related
my select is done and I have all my 200 records..... now I want to display only the 10 newest one.
do I need to specify something special in the Select or a simple Response.write will do the thing? Either way, am at lost as to what to do.
View Replies
View Related
I am doing a simple program which display random records to students.The student table has the following fields(Access Database) Code:
1.Studentid-Number
2.Studentname-Text
3.Class-Text
4.Ans-Text
and Question table as
1.Questionid-Number
2.Questions-Text
Now What i am trying to do is , when the first time is student is login,he wil be shown a random record from the question and his answered wil be stored in the Ans field of the student table with column separeated.
The he will be redirected to the same page with one new question.This question should not be in the Ans Field, and must be randomly generated.I am using this code.But this not working. Code:
View Replies
View Related
i am inner joing two tables customer and program. if i use select distinct i still get duplicate records displayed. how can i display distinct records for a customer by cust_no but still pull fields from program.
my customer and program table are joined by the cust_no field but in the program table the customer may have 10 different programs.
I tried "Select DISTINCT customer.cust_no ,customer.lastname, customer.firstname, program.season inner join program on customer.cust_no = program.cust_no"
View Replies
View Related
i have a database with 60 records. I display all of them into a single column. What i want to do is to display the records in a table with 2 columns, the half of them into the first left column and the rest 30 to the right column.
I used the RecordCount to count all my records but how will i count the half of them and when the half is reached i will change the column and go to the right one?
View Replies
View Related
Basically, what i want to do is select all records that match a value (1 for instance) in a feild(userID), then Display Only 3 in its own column on a table row on the page, then create another row and display the next 3 records in the same format from the same select query.
i think its got to be somehow possible with a For statement, but i cant think what.
Is it Possible to this and if so how?
View Replies
View Related
I'm trying to display records from a table in a sql database.The problem is, every month a new table is created, so I don't know what the name of that table is going to be.
It there a way that I can make sure the sql only reads from the latest created table?
View Replies
View Related
I have all the text for all pages and sub pages in the database, also news, events you name it everything is dynamically driven.
Now I have come to the sitemap page, and thinking about how to go about displaying all of the pages.
Can anyone give me some ideas of a way in doing this. How would you approach this task. Obviously this needs to cater for new pages being added by the client when he or she decides to add them.
View Replies
View Related