Join And GetRows

I'm using the following JOIN query;

Code:

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.

View Replies


ADVERTISEMENT

GetRows + GetRows?

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

Can this be done in some way with arrayas? How?

View Replies View Related

Can GetRows() Do...

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?

View Replies View Related

GetRows

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 ....

View Replies View Related

Getrows()

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?

View Replies View Related

Using GetRows()

I am getting information out of a table to place into to an Array.

rs=DataConn.Execute(strSQL)

At this point I place it into the array

objArray=rs.GetRows()

But how do I handle things if the rs came back blank? What happens is that the loop encounters an error?

View Replies View Related

Rs.GetRows Issue

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:

View Replies View Related

Pages And GetRows

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

Code:

View Replies View Related

GetRows() & Arrays

I have the following:

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 '|' ??

View Replies View Related

ASP Getrows And SHAPES

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.

View Replies View Related

Getstring / Getrows

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.

View Replies View Related

GetRows() And Hyperlinks

<%
' 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?

View Replies View Related

Difference Between Getrows

What is the difference, and when to use one over the other?

View Replies View Related

GetRows Method

When querying a database, I know I can fix the no. of returned rows/results to 20 (for example) using the GetString method:

myVar = objRs.GetString(, 20, , ,)

What syntax do I need to use to do the same with the GetRows method:

myVar = objRs.GetRows ?

View Replies View Related

JScript & GetRows

I currently thinking of converting from my little knowledge of
VBscript to jScript ASP.

With this in mind I'm looking at my current code to see how it will
convert over to Jscript.

One thing I have spotted that I can't think of a way round is the ADO
recordset.GetRows command.

I have a VBscript class that handles my DB connections so in short I
can do things like

MyArray = clsDB.GetRecordsInArray("Stored Proc Name/SQL", other
params)

and this would return the rows into a 2 dimension array.

Problem is I've read that Jscript only has one dimension. So how is
the "getRows" solved for Jscript.

Also is there any good "Jscript" code learning sites?

View Replies View Related

Getrows Get More Than Rs Length!!

I am reading an recordset into an array using getrows, but my recordset has 38 records but my array has 46!!

If I loop through the array, it errors on number 38 (as expected). I am using UBound to find the array length.

can anyone think what is going wrong, without the need to post my code (step 2!)?

View Replies View Related

Getrows, Paging And Limiting

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

or will this slow things down?

View Replies View Related

Getrows For Categories Then Products

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:

View Replies View Related

MyArray = Recordset.getrows

would this code give an EOF or BOF error if there are no rows in the
recordset? or the array myArray would be just null?

View Replies View Related

Getrows And Dicitonary Objects

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.

View Replies View Related

Class To Ease Use Of GetRows()

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.

View Replies View Related

GetRows With Field Names

When using RS.getRows how do I go about getting the field names from the database as well?

View Replies View Related

GetRows And Insert/Select Statements

I'm using an SQL statement like the following:

Code:

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?

View Replies View Related

Getrows(), Load Column Into Variables

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.

View Replies View Related

IsArray Doesn't Work With Array Var Populated With Xxx.GetRows()

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:

View Replies View Related

Inner Join

I am trying to create a record set using data from two tables. I am using the following code-
Dim objRS
oracleConnection.CommandText = "SELECT CONTACT.CONT_FNAME, LOGIN.LOGN_USER_EMAIL " &_
"FROM CONTACT INNER JOIN LOGIN ON CONTACT.LOGN_ID= LOGIN.LOGN_ID WHERE CONTACT.CONT_ID LIKE 3"
oracleConnection.CommandType = adCmdText
Set objRS = oracleConnection.Execute

Set oracleConnection = Nothing

While Not objRS.EOF
Response.Write objRS("CONT_FNAME") & " " & objRS("LOGN_USER_EMAIL")
objRS.MoveNext
Wend

I am getting an error at the line
Set objRS = oracleConnection.Execute
The error is
SQL command not properly ended

View Replies View Related

INNER JOIN

I have three tables in the DB MySQL:

TABLE_V = id, codebar, description
TABLE_C = id, codeplu, description
TABLE_M = id, internalcode, description

In the tables TABLE_V and TABLE_M for each record the descriptions are the same, Is different in the table TABLE_C.

Relations in the tables:

TABLE_V.CODEBAR ===> TABLE_C.CODEPLU
TABLE_V.DESCRIPTION ===> TABLE_M.DESCRIPTION
TABLE_C.CODEPLU ===> TABLE_M.INTERNALCODE

I must query INNER JOIN into three tables to extract CODES and corresponding DESCRIPTIONS, its possible ?

View Replies View Related

Inner Join

I can't seem to get the syntax right for an inner join statement, its based on one main table and two linked tables,

From Employee inner join((Department ON Employee.Department_Code=Department.Department_Cod e) Location ON Employee.Location_Code=Location.Location_Code)

or something to that effect. Employee is the main table and Dept,Location contain all dept/location codes+descriptions.I'm sure its pretty simple just can't get it right.

View Replies View Related

INNER JOIN

I have 2 tables I want use join to use their data its working but it will return twice of each record.

this:

strSQL = "SELECT Foods.*,SeFoods.* From Foods INNER JOIN SeFoods ON Foods.food_id = SeFoods.food_id WHERE SeFoods.type = 1 ORDER BY seFoods.sf_id DESC;" .....

View Replies View Related

Inner Join

I need to insert simple SQL Queries (joins) in an ASP page.

Select Count (*) from
Fileindexqueue Q,
Domains D,
Files F
Where D.ID = Q.DOMAINID
and Q.FILEID = F.ID
and D.NAME = 'GAINS_GTN'

My ASP code where queries can be inserted looks somewhat like this:

strSQL = "SELECT COUNT(*) AS COUNTOF FROM FILEINDEXQUEUE where (SERVERFLAG = 'Failed')"
objRec.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly, adCmdText
Response.Write "<P Class=""clsMono"">Files Failed&nbsp&nbsp&nbsp: <b>" & objRec("COUNTOF") & "</b>"
objRec.Close ...

View Replies View Related

SQL (INNER JOIN)

in this code, Code:

strSql = "SELECT tblClippings.fldClippingID, tblTopics.fldTopicName, tblMessages.fldMessageID, tblMessages.fldMessageTitle, tblMessages.fldMessageCreated, tblPeople.fldPersonDisplayName, tblMessages.fldTopicID FROM tblTopics.fldTopicID INNER JOIN (tblPeople INNER JOIN (tblClippings INNER JOIN tblMessages tblClippings.fldB_MessageID = tblMessages.fldMessageID) ON tblPeople.fldMemberID = tblMessages.fldPersonID) ON tblTopics.fldTopicID = tblMessages.fldTopicID WHERE (tblClippings.fldB_MemberID=" & iPersonID & ")"

after the FROM statement, I am getting confused. It gives error message. I think the problem is just about here,

FROM tblTopics.fldTopicID INNER JOIN (tblPeople INNER JOIN (tblClippings INNER JOIN tblMessages tblClippings.fldB_MessageID =

View Replies View Related

SQL JOIN

I am in the process of creating an ASP application to read a SQL Database. I
have imported the database from an Access Database. The Database holds
Client details, such as Agent Name, Address, Telephone. etc. in a table
called Client Code:

View Replies View Related

Inner Join

I have been racking my brain with this and I just can't seem to figure it out. Here is what I am trying to do. I have 3 tables named Registration, Events, and Customer.

I want to produce a page that lists all events and the number of attendees and who is attending each event. I assume that the only way to do this is by using an inner join and I am having a hard time grasping it.

My registration page has three fields
(customernumber,eventid,eventdate)
My events page has five fields
(eventid,eventdate,place,description,numberofattendees)
and my customer table has three fields that I need to use
(firstname,middlename,lastname,customernumber)

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved