Recordcount From Command Object
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
ADVERTISEMENT
I am getting the above error when trying to execute the following code:
View Replies
View Related
i am trying to count the records in an access database, and i cant seem to figure out the syntax to count the records and output a response.write with the number.
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'm getting errors when trying to access any Recordset properties and methods
"Object Doesn't support Property error" MoveNext
"Object Doesn't support Property error" EOF
"Object Doesn't support Property error" RecordCount
I'm using a DSN and ADO do I have to change to an OLE DB connection?
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 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
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
View Related
I'm simply trying to get a number of records returned in a recordset, and
just get a -1. I have looke din a few books and other references, can't
seem to find any answers. Anyone have any idea why I can't get a real
number? For the record, the recordset is not empty. In fact, it has many
records which I can see plainly on the screen. But when I do response.write
rs.recordcount, it just shows -1
View Replies
View Related
i tried using a few method from the forum and fail. So anyone can help me out with this, i wanted to count the total number of record in the on of the table Namecard, so tried this code but fail, anyone can help me out? Code:
View Replies
View Related
Our application currently runs on aWindows 2000 Advance server with Oracle 8i and Microsoft IIS 6.0. We are changing servers and will now be running a Windows 2003 server with Oracle 8i and Microsoft IIS 6.0.
The .RecordCount property does not work on the server. It returns a -1. We have not changed any code.
Any idea why this would happen? Are there certain parameters that have to be set to get the .RecordCount to work?
View Replies
View Related
I have an ASP page calling a VB COM calling an SQL Server stored procedure. What I would like is to return a recordset to ASP (works fine) and obtain the RecordCount (doesn't work).
The problem seems to be the difference between adOpenForwardOnly and adOpenStatic of the recordset (adOpenForwardOnly is default and doesn't support RecordCount). Unfortunately, I'm unaware of how to specify adOpenStatic for the recordset.
I've seen the "RS.Open SQL, Connection, adOpenStatic, adLockReadOnly" method, but my recordset is populated by a stored procedure "Set objRS = objCmd.Execute" ... any ideas how I can obtain the RecordCount (short of having the stored procedure return a count)?
Also does it matter where I specify the adOpenStatic (ie, in VB COM or ASP)?
View Replies
View Related
SET objRds = Server.CreateObject("ADODB.Recordset")
objRds.CursorType = 1
objRds.LockType = 3 'adLockOptimistic
objRds.ActiveConnection = objConn
objRds.open strSql
objRds.Recordcount
when i run the srl in query anaylzer, i get records, more than 1 but record count gives me -1 .
View Replies
View Related
I've like to check whether the recordcount equals 0, 1 or greater than 1. I'm still getting to grips with ASP, but hope this isn't too hard. Coming from CF background - have sussed out conditional stuff in ASP, but need to do recordcounts for validation.
View Replies
View Related
I have this:
intTotalNumNewsEntries = rsNews.RecordCount
to count total records in rsnews table, how do i change this to count not all the records, but count the records that has a certain field with a value in it? ie:
intTotalNumNewsEntries = rsNews.somedbfield.RecordCount
View Replies
View Related
I know for a fact that in my database, I have three records under the users
table. However when I execute this code:
View Replies
View Related
When I use the following, the RS.recordcount is -1. I also can't do a RS.moveprevious.
What have I overlooked? Code:
View Replies
View Related
I'm using multiple recordsets on a page, and they are all returning correct results and enough of them. My problem is when I try to access the recordcount property rs.recordcount, they all return a result of -1. This would usually mean that no records are returned. So why is showing my recordsets that are displaying records with recordcounts of -1. I can't seem to figure out.
View Replies
View Related
can anyone tell me why this chunk of code returns "-1"
'dbcnx is database connection
sql = "SELECT * FROM articles"
Set rsArticles = dbcnx.Execute(sql)
rsNumRows = rsArticles.RecordCount
Response.Write("Viewing " & rsNumRows & " record(s).")
even though the db has pulled at least 10 records... i cant figure it out... it has broken alot of my code.. and i've been forced to find different means of making the same code work in asp that i could write quickly in php. i'm trying to learn asp now, and i'm just having problems with this..
View Replies
View Related
I have:
strSQL = "SELECT * FROM newarchive WHERE Program_Title LIKE '%" & program & "%' ORDER BY ID"
set objRS = objConn.Execute(strSQL)
Response.Write "There are " & objRS.RecordCount & " results."
I get -1 for the count on every search.
View Replies
View Related
I searched the web for this, but couldn't find any reason as to why this was happening to me. I have a database set up with one record in the students table. I just issused a query "SELECT * FROM students" to test my DB. When I try to get the number of records with adoRS.RecordCount, it returns a -1.
Code:
set adoConn = Server.CreateObject("ADODB.Connection")
set adoRS = Server.CreateObject("ADODB.Recordset")
adoConn.Open "DSN=myodbc"
adoRS.ActiveConnection = adoConn
adoRS.Open "select * from students"
response.write(adoRS.RecordCount)
I do have an entry in the students table, so the RecordCount should be 1. BTW, I'm using the latest MyODBC 3.51 driver.
View Replies
View Related
recCount = rsFaq.RecordCount
Response.Write("Total number of records: " & recCount)
it outputs -1 even though there are 4 records, how come?
View Replies
View Related
i use this code;
Dim aCount
rsArchive.Open "SELECT * FROM qryArchive", db
aCount = rsArchive.RecordCount
but why aCount is still -1? the actual recordcount should be 4?
View Replies
View Related
I'm having a hell of a time with this...
From researching multiple websites, specifying the asOpenStatic cursor should return the correct RecordCount.
Here is my code:
sql = "SELECT UserID,UserName,Password,AccessLevelID,LockThreshold,Active FROM tbl_users WHERE UserName = '" & username & "' and Password = '" & password &"' "
set rs_login=Server.CreateObject("ADODB.Recordset")
rs_login.Open sql, conn, adOpenStatic', adLockReadOnly, adCmdTable
if rs_login.RecordCount <> 0 then
Response.Write("Login Successful" & "<br>")
Response.Write("Record Count: " & rs_login.RecordCount)
end if
I know I can use the select count(*) instead, but I've been researching this for quite some time now and I would like to know what's wrong.
View Replies
View Related
im having returning the recordcount of my recordset. i have already set the cursor to be adOpenStatic but it still returns -1.
View Replies
View Related