I'm using getRows in two different SELECT stataments and want to know if it's possible to place the data in the two getRows into one array? Lets's say I have something like this:
Set rs = Server.CreateObject("ADODB.Recordset") strSQL = "Select test FROM Table WHERE id = "&id&"" rs.Open strSQL, Conn contentFirst = rs.GetRows
Set rs2 = Server.CreateObject("ADODB.Recordset") strSQL2 = "Select id FROM Table WHERE id = "&id2&"" rs2.Open strSQL2, Conn contentSecond = rs2.GetRows
Now what I want is a variable that holds the content of contentFirst and contentSecond like this: content = contentFirst + contentSecond
I was reading a sample on ASP101 (i love them), and it was, I think, saying u could specify the record u want to start at...is that true? If so, I think EVERYONE should use it...it would be very cool.
Because, if u need the 6th record, u can just get it, but, using a recordset, it would be, i believe, impossible...right?, or is that wat bookmarks are for?
I tried to get the data in array by using getrows. Data will be display in the drop down list in the future. i call a function to get the data. It should be return 8 rows of the data. But it return 0 row of data ....
I'm using getrows to return the values from two columns in a MSSQL sql
database. Looping through them like so: dim irowloop, icolloop, i for irowloop = 0 to ubound(instances, 2) for icolloop = 0 to ubound(instances, 1) response.write("<option value=""VAL"">") 'get 2nd col val response.write(i(icolloop, irowloop)) response.write("</option>") next next
How can I get the value of the second column into the VALUE=""attribute in the drop down?
Since I never user .GetRow, (because arrays drive me crazy) I thought I'd give it a shot with something I had to do, unfortunately I get several errors. Code:
I built a recursive forum (tree) with ASP (VBS) and getRows and the DB Microsoft Access. When I tried to add a pages division (with ADO) it destroyed everything The relevant code:
The ADO pages devision:
rs.PageSize = MessagesNum rs.CacheSize = MessagesNum If Not rs.EOF Then PagesCount = rs.PageCount rs.AbsolutePage = Page arr = rs.getRows End If
dim app_ids, irowloop, icolloop app_ids = get_app_logins(session("stremail")) for irowloop = 0 to ubound(app_ids, 2) for icolloop = 0 to ubound(app_ids, 1) response.write(app_ids(icolloop, irowloop) & ",") next 'icolloop response.write("|") next 'irowloop
That returns:
0,0,bobsmith,pAssWord,|0,71,tom,tom,|0,71,tomf,pAs sWord,|1,5,tom,a1,| Is it possible to remove the final ',' before the '|' ??
I recently learned about the wonders of the getrows statement on a recordset (IE alldata=rstemp.getrows). It dumps a recordset into an array, that I get. Sounds great! My question is: Is there a way to support a SQL shape statement using the getrows statement? I'm guessing that if I try to throw that into a variable it may not like it.
I know that getstring or getrows increase performance but my question when to use this method. This is because what I know is this method will output all fields in a table and not just certain few.
<% ' Loop through the array holding the result set and display the data For iCounter= varC1Begin to varC1End Response.Write("<a href=prices.asp?manuf=" & arrResultSet(0,iCounter) & ">" & arrResultSet(0,iCounter) & "</a><br>") Next %>
In the above Response.Write statement arrResultSet(0,iCounter) displays the manufacturer just like it should.
However, within the hyperlink, if a manufacturer has 2,3, or more words, it will only show the first word. Anything after the first space is ignored. Why?
strQuery = "SELECT whoisserver.host, [domain].domainid, [domain].[domain]" & _ " FROM [domain] INNER JOIN [whoisserver] ON [domain].whoisserverid = whoisserver.whoisserverid"
Which works perfectly. when I use getRows to store the results in an array, the whoisserver.host field isn't in the array. Only the domain.* fields are in the array. Anyone know why this is, and how to solve it? I really need that whoisserver field.
I'm using getrows to speed up data access time, i wonder though if there is a better way. Each recordset returns up to or more than 500 records, this is still quite an overhead for the server when there are lots of people on the site.
Rather than reading all 500 records into the array and then paging the results is it possible to create the recordset with just 25 entries?
ie if you are on page 1 then only the first 25 records are retrieved from the database, page 2 - records 25 - 49 are retrieved etc
im developing a Product configurator (just like alienware use) where in my database i have (systems table) a list of PC systems
systemID (categories table) a list of PC product categories (ie. CPU, RAM...) categoryID (products table) a list of all products productID, catID (link table) sysID and prodID
Now before i put the code ive done so far, let me explain that the first page lists all systems wich then gives the systemID for the link table. Once this page loads it needs to go through each category then list the products available to that category where sysID = systemID. Now a query i put together to list all products for that sysID is:
select * from PRODUCTS inner join link on link.prodID = PRODUCTS.productID where link.sysID=systemID
Now this query works great and lists all of the products for that systemID, but what im unable to do is (using GetRows()) have the category name listed as a title then have each product under the respected category. Code:
I can't seem to get the getrows function of an ADO recordset to work or get a dictionary object to work. I've made them work on other servers before using the same code.
Server is running Windows Powered and IIS 5.0I can provide code, but you must believe this code has worked on other servers.
I was bored this weekend and after reading a couple articles and posts about GetRows() being WAY better than the usual way, I thought I would try and make a class to make it similar to using a recordset.
It's far from finished but I thought I would throw it up here and see what everyone thought. Am I wasting my time? I have no real way of benchmarking the possible improvements but I haven't been able to notice a difference yet. Anyway, you can download it here. The zip includes the class file and an example asp file.
INSERT INTO table (field) VALUES (value) SELECT @@IDENTITY AS NewIdent;
If I run it through a command prompt (osql.exe) it works fine - it inserts the data and returns the new identity. However, when I try to pass this through my nifty GetRows() function the stupid thing chokes (it acts like a normal INSERT statement has been passed - "ADODB.Recordset (0x800A0E78) Operation is not allowed when the object is closed." on the line where I try to execute GetRows).
I've looked through my ADO documentation and don't see any reason why this should be happening (since it does return data). Due to the small amount of data, I'm going to just use a plain old RecordSet object, but for my own piece of mind does anyone know why it won't treat the returned @@IDENTITY variable like normal data?
if there is anyone knows if its possible to put a database columns' value such as ( Title, Name, IP, Phone, Address, etc... ) into array then retrieve them to be displayed on page via Access in ASP using getrows but utilize something similar to rs("Title"), rs("Name"), rs("IP"), etc., or create temperay new variables such as rs(vTitle), rs(vName), rs(vIP), instead of using the rs( row, column ).
The reason I am asking is that when a table has many fields, its gets hard to track down the right array number instead of simply using its column or field name.I have written paging scripts based on ADO method of getting rs("FIELDNAME") to display datas, and I am trying to convert it to utilize getrows() method, but having trouble with the array column sequence.
I'm using .getRows() with a local var array instead of doing a recursive loop so that I'm being a good ASP newvbie and closing my object i/o's (the recordset in this case) as quick as possible.
My problem is that I can't seem to use this to complete good effect because the IsArray statement doesn't seem to work with a local var array that has or has not been populated with the .getRows() property.
To explain, I used to do the following recursive loop (simplified to show a concise example): Code:
I have an interesting situation that needs to be addressed ASAP.
I am running a standard SQL Query in ASP to retrieve some rows/columns from a table that's on a SQL Server 2000 database. I put the results of that query into a RecordSet, and then use the GetRows function to push the results that are in the recordset into an array variable. In the query that I am running, 39 columns and 2 rows are returned.
The GetRows function appears to be working - the array variable is being created with the proper dimensions. However, the values of the different "cells" of the array are not showing up correctly. The first and the last column values for each row are correct, yet everything else in between is blank, empty, NULL, or whatever.
In other words: ArrayVariable(0,0) shows up correctly, ArrayVariable(38,0) shows up correctly, but everything in between is null.
I did a test on the RecordSet and discovered that it was the culprit - it wasn't being filled in properly. This is strange, though, because the select query that I run in the ASP code to create the recordset returns perfect results when I run it on the SQL Server 2K database.
I have downloaded the DiscIDCalc program from CDDB. I've used it a lot because I've written my own application for my CD collections (keeping track of the track information of each CD, track duration etc). I've already got all my CDs into the application, I'm now just going through each of the disc again just to add in the DiscID information. I do it by running the DiscIDCalc program, generating the DiscID, and then then copying and pasting this DiscID into my application and then save it. if anyone has successfully generated the DiscID within an asp page? Now I have to have my browser up and this DiscIDCalc program up. Just want to know if there's a way to incorporate the two together (even if it means I'm not using the DiscIDCalc anymore.). This DiscIDCalc has a documentation for its DiscIDCalcDLL.dll but it's not something that I can CreateObject with, so I'm quite clueless... I don't want to use VB to write APIs for that
I use query string to search for records by using GET method. This method will generate querystring automatically by using the form name. Using search field together with drop down is fine but the problem is when i didn't enter any keyword or left the search field blank it won't display any result.
Unless I put "%" in the search field. How do I make the querystring change to "%" whenever the field is blank so that all records will be displayed.
i am trying top update a field in my sql database but it wont let me??? does anyone know if my syntax is correct?? I have a field called userId in the database and want to replace it with my form request. Code:
Method Not Allowed The requested method POST is not allowed for the URL /Database/processForm.asp.
Apache/1.3.33 Server at antonyx.freestarthost.com Port 80
i just got this error, however, i have managed to post data into my database on this server b4, why is this error comin up now, could there be a prob with my asp file??
When using ActiveX Combo Boxes, can you use the GetString method to populate the control? I currently am using AddItem, however, it is taking a long time to process. I know that GetString works well to improve the performance. Here is my code while using AddItem:
Now this is a weird one. I'm having a problem with a system in development. When I post data from a form in IE 5.01 it works fine, but in IE 5.5 it refuses to post the data to the server and in IE 6 it's scatty -- works sometimes but not others. Anyone seen this before? Edit: By the way -- this is normal VBS/ASP running on IIS 5 on an NT server