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.
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:
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.
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:
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?
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'
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:
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?)
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
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:
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?
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)?
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.
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:
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.
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..
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")