I've created a Stored Procedure which adds a new record and updates some more records and then returns the primary key for the added record.
The SP seems to work OK, but I'm having problems getting at the returned key in my ASP code:
"Item cannot be found in the collection corresponding to the requested name or ordinal."
A common error, but in this case I can't see why... I output the SQL instruction that is sent to the DB and have run it in Query Analyser and it runs OK and returns a single row, with a single column - the new primary key...
But when I try and access this in ASP, I get the error message....
SELECT ISNULL(Group, '') AS GroupCalc, MIN(start) AS START, COUNT(Id) AS Count FROM Table WHERE (Id = @CId) GROUP BY ISNULL(Group, '') ORDER BY start GO
What is the simplest way to open up a stored query in Access - I'v got this far but I need to open: qry_Listings.
set cnn = Server.CreateObject("ADODB.Connection") strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("../database/listings.mdb") '//This one is for Access 2000/2002 cnn.Open strCon
as I'm in the process of performance tuning, I'm trying to receive a NUMBER type array from a Stored Procedure.I made a VARRAY OF NUMBER in my stored procedure. I'm not able to receive this in a Function in ASP.
I would like to call my stored proc and invoke the WITH RECOMPILE option. I can't figure out what to set in ADO to make that happen. how to make this work? BTW, I _don't_ want to create the stored proc using the WITH RECOMPILE.
I am trying to pass a VBScript Date variable as value to an ADO adDate parameter of a stored procedure (which runs in an SQL Server). If I add the parameter like this:
where oCmd is of type ADODB.Command and dParam is a VBScript variable of type Date then when trying to execute the stored procedure I get the following error:
Optional feature not implemented
I was able to get round this by passing a string value in an adVarChar parameter, but it would be easier and more readable with adDate and Date-type variables. Is this latter possible?
Is it possible to call a stored procedure asynchronously from an ASP page? We would like to be able to execute a proc and have the page continue to process without having to wait for the proc to finish. I know you can make a dll and call it from there, but we'd rather just be able to keep it simple and call it from the page if we can.
Would anyone be kind enough to give me a solution to the problem below please?
If for example in the stored procedure looks like this:
-- Initialize the SQL Server XML stored procedures EXEC sp_xml_preparedocument @xmlDoc OUTPUT, @xmlString
Insert into @TableBook SELECT * FROM OPENXML (@xmlDoc, 'books/book') WITH ( bookNameVARCHAR(100) 'name', authorVARCHAR(100) 'author' )
The question is supposing there is a node called 'Surname' but I am not adding 'Surname' to 'Author'. If I want to check 'Surname' value DOES exists and I want to replace it with 'Author' or if 'Surname' does not exist, just use 'Author' node instead.
I am not sure how you can use IF statement to check a node and put the value into SET @surname and then put something like author VARCHAR(100) '@surname' OR author VARCHAR(100) '@Author'. Just like switching it around.
I am trying to run the following t-sql stored proc from my VBScript page
Create Procedure getUserInfo ( @login nvarchar(8) ) AS USE proj_dashboard SELECT f_forename, f_surname, f_profile_id FROM t_users WHERE f_login = @login
basically I wasnt to pull in the login of the user pass it to the proc and pull out the info for that user. I use the following sql statement Code:
I need to return XML from a SQL Stored Procedure which I will execute through ASP ADO code. Stored Procedure as below:
CREATE PROCEDURE pr_GetJobInfo2 @JobType int, @CntryID int, @JobTitle varchar(8000) OUTPUT AS SELECT @JobTitle = ltrim(rtrim(JobTitle)) FROM dbo.JOBS WHERE JobType = @JobType AND CntryID = @CntryID FOR XML AUTO [code]
Now the output parameter (@JobTitle) cannot be assigned to FOR XML, so what must I do ??? My ASP code reads as: ....
Is it possible to add a stored proc to a table adapter and execute the proc inside an ASP button click event?
I have a table adapter called Claimers and a sp called AddWatch. On the onclick event I would like to call the table adapter and execute the sp. Note that the sp does not return records. Code:
I have a stored procedure, which receives 3 parameters and returns a record set. Now if i pass a wrong id, or different checks in the stored procedure fail my record set does not open Here is the code:
// 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
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?
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.
I've been trying to find a simple way to count the records returned from a database query short of looping through the recordset and incrementing a counter.
I've tried the following without any success:
Ubound(select_rs) - afterall the recordset is returned in an array right? Ubound gives the following error: Microsoft VBScript runtime (0x800A000D) Type mismatch
I've tried select_rs.count which gives the following error: VBScript runtime (0x800A01B6)
Basically, I've reached the point where I think I may have to loop through the recordset and count the number of records returned. Seems like an awfully inefficent way to do something so simple.
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 ?
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.
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.
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
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.
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.
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.
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.
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.
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?
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:
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().
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.