How To Put Data From A Recordset Into A Table

Jun 24, 2004

I want to transfer a recordset (derived from an Oracle datasource) into
an SQL2000 Server table using VBScript in a ActiveX Script Task using a DTS.

Currently I use the OPENROWSET (and OPENQUERY) method, however
the lenght of the querytext seems to be limited to 8192 bytes.
At this moment I have reached the limit of this lenght, and I am looking
for a solution.

Futher info: The query returns large recordsets of 100,000s of records with 100s of columns. Because of it's complex structure, the standard data transformation in SLQ2000 is not an option.

Using a substitute like:

varRecords = rst1.GetRows
For intI = 0 To UBound(varRecords, 2)
rst2.AddNew
For intJ = 0 To UBound(varRecords, 1)
rst2(intJ) = varRecords(intJ, intI)
Next
Next
rst2.Update

works fine but is much to slow.

Can anyone help me to find a solution?

View 2 Replies


ADVERTISEMENT

Data Conversion From String To Decimal When Saving Data To SQL Server 2005 Using An ADO Recordset

Feb 12, 2008

Hello,

I am wondering what conversion rules apply, when a string, which contains a number, is saved to a SQL Server 2005 into a column of type decimal.

This is the code I€™m using (C++):

CString cValue = "0.75"
_variant_t vtFieldValue;
vtFieldValue = _variant_t(cValue)
pRecordSet->Fields->Item["MyColumn"]->Value = vtFieldValue;

"pRecordSet" is an ADO recordset. The database column "MyColumn" is of type "decimal(19,10)".

The most important question for me is, if the regional settings of the database server or the regional settings of the client PC are considered during the conversion from the string to the decimal value. For example in standard French regional settings the "." would not be recognized as decimal separator.

I am also wondering if the language of the database instance, in which this data is saved, is considered during this conversion or any other settings of this database instance.

So my general question is: Does anybody know exactly what rules apply during the above mentioned conversion?

Thank you for your help.

Regards,
Volker

View 2 Replies View Related

Recordset From Two Data Sources

Mar 7, 2002

Is it possible to create a recordset from two different datasources?

Such as
SELECT * FROM DataSource1.TableName WHERE ColumnName IN (SELECT Column FROM Datasource2.TableName)

Thanks.

View 1 Replies View Related

Recordset From Two Data Sources

Mar 7, 2002

Is it possible to create a recordset from two different datasources?

Such as
SELECT * FROM DataSource1.TableName WHERE ColumnName IN (SELECT Column FROM Datasource2.TableName)

Thanks.

View 2 Replies View Related

Recordset Can't Retrieve Data

Nov 29, 2006

I have two dbs with the same table names and fields but different data. My connection is right, as well as my query.
How come that my program can't access the data from one table while the there's no problem with the another one? My recordset is empty even the record I'm searching for exists. It's rs.recordcount is -1. Is that database corrupted?

View 8 Replies View Related

Get Recordset Data From SQL 2005 In ASP

Jan 22, 2008



Dear All,

I hope someone can help me in this problem. I create the Procedure to generate the dynamic SQL statement, and execute the dynamic SQL at end of the Procedure. When I done in Server Management Studio, all thing is OK, return me the record.

But when i use it in ASP, the statement as below





Code Block
Dim objCmd
Set objCmd = Server.CreateObject("ADODB.Command")
With objCmd
set .ActiveConnection = objCn
.CommandText = "MyProcedure"
.CommandType = 4
.Parameters.Append = .CreateParameter("@Par1", 200, 1, 10, Par1)
.Parameters.Append = .CreateParameter("@Par2", 200, 1, 8, Par2)
.Parameters.Append = .CreateParameter("@Par3", 200, 1, 1, Par3)

Set objRs = .Execute ()

If Not objRs.EOF Then
ID = objRs.Fields.Item (0).value
Name = objRs.Fields.Item (1).value
End If
objRs.close
End With

set ObjCmd = nothing






The Error below display, Why??




Code BlockError Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.



And this is work fine in SQL 2000 before


View 3 Replies View Related

Render Just The Raw Data From The Recordset

Feb 1, 2008


Is there a way to return just the raw data from a report? I do not mean XML rending which marries the dataset information with the layout information. I just want the raw data from the dataset. If the XML returned was the result of the recordset from the de-parameteraized query only that would be great!

I am looking into writing a Custom Rendering Extension, but I am not fining much outside of the same MS example circulating. It seems to only deal with layout data and not the raw dataset data.

Is there way to get to just the raw data and ignore layout? Is the dataset in the SSRS Temp Dd that you can query after a report has run? If anyone knows of any way to get to the raw data that would be fantastic.



Thanks!

View 3 Replies View Related

How Can I Retrieve A Recordset From A Matrix-like Table?

Feb 3, 2004

I have a table defined as (int Row, int Column, money Data); as it were a matrix.

Which is the more efficient way of retrieving a result set with the following form?

Column1 Column2 Column3
---------- ----------- ----------
Data11 Data12 Data13
Data21 Data22 Data23
Data31 Data32 Data33
... ... ...


Thanks a lot in advance.

View 1 Replies View Related

Using A Recordset Source In A Data Flow

May 17, 2007

I have been using a recordset destination in a data flow where I need to perform some complex manipulation on a dataset, including combining some information from a web service and updating records that already exist, vs. inserting them.

I have a script task that modifies the dataset as needed, and then saves it back to the variable it came from.

However, when it comes time to write the data to the database, I couldn't find an appropriate tool - there's no "recordset source" object in the data flow task, and use of a "for each" loop with a sql call to a stored proc takes 20 minutes for a few thousand rows.

The best way I could find around this was as follows:



Call the .NET ".GetXML" method on the dataset and put the resulting XML data into a string variable
Generate an XSD for that XML (it comes out like <NewDataSet><Table1>...)
Use an XML source in the data flow task.This works, and the same data insert that took 20 minutes via the loop / stored procs now takes under 10 seconds.

It seems horribly inefficient to have to do this - there should be a way to just dump my dataset back into a table natively without all that extra stuff.

Anyone done anything simillar?

View 1 Replies View Related

Read Table Description Into ADODB.Recordset.

Aug 20, 2003

How do I read the Tables description into ADODB.Recordset and then recreate the Tables+description into a new database from the ADODB.Recordset.

View 1 Replies View Related

Write Sproc Recordset Into A Temp Table

Jul 12, 2006

I need to call a sproc about 1000 times and build a table from all the results.

How do I write an insert statement that will take the recordsets from the sproc and put it into a temp table?

View 1 Replies View Related

Transact SQL :: Return Recordset From Dynamic Table

Sep 25, 2015

I tried to create a dynamic table, fill in it and return it as recordset. The codes as this:

Declare @tbl Table(id int, name varchar(100), age int) 
Insert Into @tbl(id, name, age)
Values(1, 'James, Lee', 28),
   (2, 'Mike, Richard', 32),
   (3, 'Leon Wong', 29)
Select * From @tbl Order By age

It works well in "SQL Query Ananizer". But return no records in ASP page.

View 5 Replies View Related

How Can You Insert A Dummy Row At The Top Of Every Related Recordset In A Table?

Jan 22, 2008

I have the following:

TicketID_1 AuditRec1
TicketID_1 AuditRec2
TicketID_1 AuditRec3
TicketID_1 AuditRec4
TicketID_1 AuditRec5
TicketID_2 AuditRec1
TicketID_2 AuditRec2
TicketID_2 AuditRec3
TicketID_2 AuditRec4
TicketID_2 AuditRec5

I need to insert a dummy row as the first row in this AuditRecord table for every occurrance of a given TicketID so that I get the following:

Dummy_Tick1 Dummy_AuditRec
TicketID_1 AuditRec1
TicketID_1 AuditRec2
TicketID_1 AuditRec3
TicketID_1 AuditRec4
TicketID_1 AuditRec5
Dummy_Tick2 Dummy_AuditRec
TicketID_2 AuditRec1
TicketID_2 AuditRec2
TicketID_2 AuditRec3
TicketID_2 AuditRec4
TicketID_2 AuditRec5

The AuditRec table is huge. How can I accomplish this using SQL?

View 1 Replies View Related

Manipulating Large Ntext Data With ADO Recordset

Mar 20, 2000

I am having a problem writing a large amount of ntext data to a field within an ADO recordset. I am using the append chunk method but it does not seem to work. The SQL 7 field will hold the data its only about 60K.

View 1 Replies View Related

Link Specific Groups Of Data To A Recordset?

Nov 4, 2007

I am new to this forum so I am not sure if this is posted in the appropriate group.

Okay - this may be a silly question - what is a crosslink table? Is this easily achieved in the MySQL query browser? Here is some more details on what I am trying to achieve. I have seen it done but not sure where to start....

The products correspond as follows:

- To be eligible for 'product a' the buyer must meet two qualifications:

1. Specify their 'model of their engine.'
2. Specify the 'year' of their engine.

Is there a way to structure my tables so that if a person specifies 'a specific year' and 'specific model' the correct product A, B, or C will pull up for them?

Do I create separate tables named 'Engine Model' and 'Engine Year' -- and then link to the product table with foreign keys? If so, how do I specify more than one grouping. For example product A is compatible with 2004-2007 engines and 10 different engine models.

I am new to mySql -- but a quick study -- hopefully this is easy to implement.

thanks.

View 2 Replies View Related

Search For Data Inside A Recordset Destination

Feb 21, 2007

Hi there,
I need to develop a module and wondering what would be the best implementation...

I get a list of files from a text file and store it in a Recordset Destination (object variable "CUST_INV_LIST").

I need to check that all the files in a directory are in the list. I can loop through the files in the directory using a ForEach container, but how do I check if it is in the CUST_INV_LIST recordset?

I thought about using another ForEach container to loop through the recordset, check if the physical file is equal to that row, if so set a flag, ... but it's neither elegant nor effective.

Another option would be to use a Script Task to search for the physical file name in the recordset. I tried with the Data.OleDb.OleDbDataAdapter, etc. but I get and error when I declare Data.DataTable. Anyways that method of accessing a recordset is not recommanded and seems complicated.

Any suggestion?

Thanks

View 12 Replies View Related

Retrieve A Recordset From One Table Based On The CSV Values In The Field Of Another

Feb 6, 2007

Hello!

I have 2 tables, one that contains a set of codes and their definitions, and another where each record has a field that contains several of these codes separated by commas:

Tab1

SubCode | Definition
---------------
S100 | Def of S100
S101 | Def of S101
S102 | Def of S102

Tab2

DepID | Purpcode |SubCodes
-----------------------------
1 | P100 | S100,S101,S102
1 | P101 | S100, S101
2 | P101 | S100,S102

I'm trying to create a query against Tab1 so that it retrieves a recordset of Subcodes and definitions based on the contents of the Subcodes field for a record in Tab2. I've tried this using a subquery, as follows:

SELECT SubCode ,Definition
FROM Tab1
WHERE SubjectCode IN
(SELECT CHAR(39) + REPLACE(SubjectCodes, CHAR(44), CHAR(39 + CHAR(44)+ CHAR(39)) + CHAR(39)
FROM Tab2
WHERE DepID = 1 AND PurposeCode = 'P101')

The subquery will return: 'S100','S101' and I expect the final recordset to be:

SubCode | Definition
---------------
S100 | Def of S100
S101 | Def of S101

However, it's not returning any records. If I execute the subquery separately and then plug its results into the main query e.g.

SELECT SubCode ,Definition
FROM Tab1
WHERE SubjectCode IN ('S100','S101')

it returns the expected recordset. Does anyone have any pointers? It's driving me nuts..

Cheers
Greg

Complete DDL, Sample Data, and Query below:


if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[SubjectCodeDefinition]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[SubjectCodeDefinition]
GO

if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DepartmentReturn]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[DepartmentReturn]
GO

CREATE TABLE [dbo].[SubjectCodeDefinition] (
[SubjectCode] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Definition] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO

CREATE TABLE [dbo].[DepartmentReturn] (
[DeptID] [int] NULL ,
[PurposeCode] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[SubjectCodes] [varchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
) ON [PRIMARY]
GO

INSERT INTO SubjectCodeDefinition(SubjectCode, Definition)
SELECT 'S100', 'Definition of Code S100' UNION ALL
SELECT 'S101', 'Definition of Code S101' UNION ALL
SELECT 'S102', 'Definition of Code S102' UNION ALL
SELECT 'S103', 'Definition of Code S103' UNION ALL
SELECT 'S104', 'Definition of Code S104' UNION ALL
SELECT 'S105', 'Definition of Code S105'
GO

INSERT INTO DepartmentReturn(DeptID,PurposeCode,SubjectCodes)
SELECT 1,'P100','S100,S101,S104' UNION ALL
SELECT 1,'P101','S102,S103' UNION ALL
SELECT 1,'P102','S100,S101,S105' UNION ALL
SELECT 2,'P100','S100,S101,S104,S105' UNION ALL
SELECT 2,'P103','S103,S104,S105' UNION ALL
SELECT 3,'P100','S100,S102,S104'
GO

SELECT SubjectCode ,Definition
FROM SubjectCodeDefinition
WHERE SubjectCode IN
(SELECT CHAR(39) + REPLACE(SubjectCodes, CHAR(44), CHAR(39)+ CHAR(44)+ CHAR(39)) + CHAR(39)
FROM DepartmentReturn
WHERE DeptID = 1 AND PurposeCode = 'P102')

View 1 Replies View Related

Loop Through A Recordset To Populate Columns In A Temp Table

Jul 23, 2005

I want to take the contents from a table of appointments and insert theappointments for any given month into a temp table where all theappointments for each day are inserted into a single row with a columnfor each day of the month.Is there a simple way to do this?I have a recordset that looks like:SELECTa.Date,a.Client --contents: Joe, Frank, Fred, Pete, OscarFROMdbo.tblAppointments aWHEREa.date between ...(first and last day of the selected month)What I want to do is to create a temp table that has 31 columnsto hold appointments and insert into each column any appointments forthe date...CREATE TABLE #Appointments (id int identity, Day1 nvarchar(500), Day2nvarchar(500), Day3 nvarchar(500), etc...)Then loop through the recordset above to insert into Day1, Day 2, Day3,etc. all the appointments for that day, with multiple appointmentsseparated by a comma.INSERT INTO#Appointments(Day1)SELECTa.ClientFROMdbo.tblAppointments aWHEREa.date = (...first day of the month)(LOOP to Day31)The results would look likeDay1 Day2 Day3 ...Row1 Joe, PeteFrank,FredMaybe there's an even better way to handle this sort of situation?Thanks,lq

View 11 Replies View Related

Disconnected Recordset Error On OLE DB Destination Data Flow

Oct 2, 2007

I have an update query in an OLE DB Destination (access mode: SQL Command) that updates a table with an INNER JOIN from another table in another database. I'm getting the error, "No disconnected recordset available for the specified SQL statement". Does this have to do with the SQL query trying to access the other database? How can I get around this error?

View 4 Replies View Related

A Recordset Obtained Via ADO Doesn&#39;t Show The First Record Using Data Report

May 30, 2001

Te first record of a Recordest obtained from a Command Object executing a Stored Procedure, doesn't show the first record when I asociate this to a data report.(VB6 - SQL7) (ADO 2.1)

If I execute the stored procedure directly from query analizer, I have obtained the right resultset.

Does anyone Knows what could be happening?

Thank You ...

View 1 Replies View Related

Data Access :: Recordset Returned By Query Have A Status Of Closed?

Oct 8, 2015

I'm running the following SQL query from LabVIEW, a graphical programming language, using the built in capabilities it has for database connectivity:

    DECLARE @currentID int
    SET @currentID = (SELECT MIN(ExperimentID) FROM Jobs_t WHERE JobStatus = 'ToRun');
    UPDATE [dbo].[Jobs_t]
    SET [JobStatus] = 'Pending'
    WHERE ExperimentID = @currentID;
    SELECT @currentID AS result
<main.img>

This is the analogous code to main() is a C-like language. The first block, which has the "Connection Information" wire going into it, opens a .udl file and creates an ADO.NET _Connection reference, which is later used to invoke methods for the query.

<execute query.img>

This is the inside of the second block, the one with "EXE" and the pink wire going into it. The boxes with the gray border operate much like "switch" statements. The wire going into the "?" terminal on these boxes determines which case gets executed. The yellow boxes with white rectangels dropping down are invoke nodes and property nodes; they accept a reference to an object and allow you to invoke methods and read/write properties of that object. You can see the _Recordset object here as well. <fetch recordset.img>

Here's the next block to be executed, the one whose icon reads "FETCH ALL". We see that the first thing to execute on the far left grabs some properties of the recordset, and returns them in a "struct" (the pink wire that goes into the box that reads "state"). This is where the code fails. The recordset opened in the previous VI (virtual instrument) has a status of "closed", and the purple variant (seen under "Read all the data available") comes back empty.

The rest of the code is fairly irrelevant, as it's just converting the received variant into usable data, and freeing the recordset reference opened previously. My question is, why would the status from the query of the recordset be "closed"? I realize that recordsets are "closed" when the query returns no rows, but executing that query in SSMS returns good data. Also, executing the LabVIEW code does the UPDATE in the query, so I know that's not broken either.

View 3 Replies View Related

Insert To Recordset Gives Different Date Format To Table Insert ????????

Jun 28, 2007

Help please!



I have an asp page with some simple vbscript to add a record to a table, the record has a datefield (dob).

the insert results in a US formated date if I add a record to a dynamic recordset but a UK formated date if I insert direct to the table ?????

i.e.

if request("dob") is "01/11/2007" (1st november 2007)





set conn = server.createobject("adodb.connection")

set rs = server.createobject("adodb.recordset")

rs.open "tez", mc, 2, 2 rs.addnew

rs("dob") = request("dob")

rs.update



11 jan 2007 stored in table



while



set trs = Server.CreateObject("ADODB.RecordSet")

qfn= "insert tez values('"+request("dob")+"')"

trs.Open qfn,mc



results in

1 november 2007 is written to the table.

Both of these methods are used in the same asp page.



This is on a windows2003 server, sql2005,iisv6, asp.netv2



I have tried every setting I can find in iis,asp,sql server to no avail.

I need the recordset method to work correctly.



Terry



View 8 Replies View Related

Creating A Stored Procedure That Will Summarize Data In A Table Into A Table Reflecting Period Data Using An Array Type Field

Sep 20, 2007

I am attempting to create a stored procedure that will launch at report runtime to summarize data in a table into a table that will reflect period data using an array type field. I know how to execute one line but I am not sure how to run the script so that it not only summarizes the data below but also creates and drops the table.

Any help would be greatly appreciated.

Current Table

Project | Task | Category | Fiscal Year | Fiscal Month | Total Hours
---------------------------------------------------------------------------------------------------------
Proj 1 | Task 1 | Cat 1 | 2007 | 01 | 40
Proj 1 | Task 1 | Cat 2 | 2007 | 02 | 20
Proj 1 | Task 1 | Cat 3 | 2007 | 03 | 35
Proj 1 | Task 1 | Cat 1 | 2008 | 01 | 40
Proj 1 | Task 1 | Cat 2 | 2008 | 02 | 40
Proj 1 | Task 1 | Cat 3 | 2008 | 03 | 40

Proposed Table

Project | Task | Category | Fiscal Month 01 | Fiscal Month 02 | Fiscal Month 03 | Fiscal Year
---------------------------------------------------------------------------------------------------------------------------------------------------
Proj 1 | Task 1 | Cat 1 | 40 | 0 | 0 | 2007
Proj 1 | Task 1 | Cat 2 | 0 | 20 | 0 | 2007Proj 1 | Task 1 | Cat 3 | 0 | 0 | 35 | 2007
Proj 1 | Task 1 | Cat 1 | 40 | 0 | 0 | 2008

Proj 1 | Task 1 | Cat 2 | 0 | 40 | 0 | 2008
Proj 1 | Task 1 | Cat 3 | 0 | 0 | 40 | 2008

Thanks,
Mike Misera

View 6 Replies View Related

Integration Services :: Purge Data In Transaction Table Or Delete Some Data And Store In Separate Table

Aug 18, 2015

How to purge data  in transaction table or we can delete some data and store in separate table in data warehouse?

View 7 Replies View Related

Stored Procedure To Copy Table 1 To Table 2 Appending The Data To Table 2.

Jan 26, 2006

Just wondering if there is an easy transact statement to copy table 1 to table 2, appending the data in table 2.with SQL2000, thanks.

View 2 Replies View Related

Recordset With SQL And VB

Jul 10, 2007

Hi,
I am trying to cycle through a table and trigger an event based on some critera. I am not sure how to do it. I am a classic VBA guy, so I might be way off:
   Dim myConnection As SqlConnection
Dim myCommand As SqlCommand
myConnection = New SqlConnection("MY SQL DATA SOURCE")
myConnection.Open()

myCommand = New SqlCommand("SELECT * FROM history", myConnection)
Dim dr = myCommand.ExecuteReader()
Dim i As Integer = 1

While dr.read()
i = i + 1
' HOW DO I CYCLE THROUGH THE ROWS AND ASK IF A FIELD EQUALS A VALUE
' field name = "Tail"

If dr(i) = ? Then
MsgBox("ok")
End If

End While
dr.Close()
myConnection.Close()
 

View 3 Replies View Related

VB.NET SQL Recordset

Jun 22, 2008

Hello, what is the best way to iterate both forward and back through my SQLDataAdapter/SQLDataReader in code?

View 1 Replies View Related

How About Recordset?

Jul 24, 2001

In VB to move a recordset, we used .MoveNext. How about in SQL?
How can I compare two fields in SQL?

View 1 Replies View Related

Recordset

Mar 12, 2006

hi
I have 3 tables:Article,Source and File.
Each article can have multiple filenames.
The fields of table Article are:ArticleID,SourceID,ArticleDate,ArticleCategory
The fields of table Source are:SourceID,SourceName
the fields of Table File:ID,ArticleID,Filename
Select*from Article inner join Source on Article.SourceID=source.SourceID order by ArticleDate
I obtain a number of recordsets from the above query.
Then for each recordset(Rs1),Let's say for the first recordset
Rs1.MoveFirst
I want to apply this query:
Rs2.Open"Select SourceName,ArticleDate,File.Filename from [RS1] inner Join File on Article.ArticleID=File.ArticleID
I want from the above query to have the Filenames corresponding to each Article because in my VB
form I have 2 command buttons:one gives me the article's definition(Date,Source)
and the other gives me the Filename of the current recordset(Article)
The above SQL syntax is it correct?

View 2 Replies View Related

How To Get The Second Row Of A Recordset?

Aug 18, 2006

Here's my SQL Statement (I'm using MS SQL 2000):

SELECT TOP 2 MenuComments, MenuDate, MenuID, MenuIsActive, MenuName
FROM Menu
ORDER BY MenuDate DESC

This orders the data correctly, but the problem is, I need ONLY the SECOND row, not the top row. Also, because I am sorting for menus entered into the system, I cannot use a variable based on real dates (in other words, I can't use the server clock to help filter the results).

Any and all help would be GREATLY appreciated -- I've been banging my head against this one all day!

Mike

View 3 Replies View Related

One Recordset Instead Of Two

Jul 11, 2007

Hi,


I am using classic ASP.
Records are grouped together by a GroupUnique number. Some groups are small with about 10 records, othere are larger at about 160.

For each record, I have about 50 columns of data that I need to display on a webpage. Because the 50 columns don't easily fit on the one page, I create two tables, each displaying 26 columns, the first columnn being an ID column. Due to the size of groups, sometimes the tables are very large - and when they get too big it overloads the server.

I think the main problem is the two tables. I use two recordsets (one of them is shown below - although instead of a SELECT * I do in fact name the columns needed for each table). I have to use two because the Recordsets don't like me using the ID column again - once it is used it is gone.

Is there a better way to store all of this information so that I can just use the one recordset? Possibly in an array? Is there a more efficient way of getting the data?








<%
Dim Recordset4__MMColParam1
Recordset4__MMColParam1 = "1"
If (Scramble.Fields.Item("GU").Value <> "") Then
Recordset4__MMColParam1 = Scramble.Fields.Item("GU").Value
End If
%>

<%
Dim Recordset4
Dim Recordset4_numRows

Set Recordset4 = Server.CreateObject("ADODB.Recordset")
Recordset4.ActiveConnection = conn
Recordset4.Source = "SELECT * FROM Table1 WHERE GroupUnique = " + Replace(Recordset4__MMColParam1, "'", "''") + ""
Recordset4.CursorType = 0
Recordset4.CursorLocation = 2
Recordset4.LockType = 1
Recordset4.Open()

Recordset4_numRows = 0
%>


<%
Dim Repeat4__numRows
Dim Repeat4__index

Repeat4__numRows = -1

Repeat4__index = 0
Recordset4_numRows = Recordset4_numRows + Repeat4__numRows
%>

View 4 Replies View Related

Recordset And Asp

Sep 2, 2005

Hi guys,

my first post. So please don't kill me!

I am having some problems. I'm pretty new to sql and really dont know how to achieve more than the basic selects etc.,

My problem is that I have a recordset on one page http://www.photoghetto.com/photo-images/animals.asp that returns the results of all the images in one category. In this case it's animals and wildlife.

The user can click on any image and go to a page that shows a larger detail version of the image. http://www.photoghetto.com/photo-images/animals-photo-detail.asp

What I do is post the ProductID number to this page so that the selected thumb is shown. So for exmaple for the image of the wild cat it is http://www.photoghetto.com/photo-images/animals-photo-detail.asp?ProductID=6

My problem is that on the animals-photo-detail.asp the user has to be able to "scroll" through all the images from the category.

I.e should be able to hit the previous image button and see the stallion image, or the next button to see the butterfly etc., and thus scroll through all the images on this age if he/ she wishes to.

I understand the principles of having a results page and then being able to click on one of the results and getting a detail page. Such as I have it here. With the http://www.photoghetto.com/photo-images/animals.asp as a results page listing all the results of the category, and then when the user clicks on one of the results, goes to a detail page, for example, http://www.photoghetto.com/photo-images/animals-photo-detail.asp?ProductID=6.

My problem is that what I need is the recordset from the listing page to function on the detail page so that the user can scroll through the results in the same order that they were on the results page.

I have searched now for a couple of days online and every tutorial I find shows the same structure. Results Page > Detail Page.

The sql i am using on the detail page is simply,

<%
Dim photos_rs__MMColParam
photos_rs__MMColParam = "1"
If (Request.QueryString("ProductID") <> "") Then
photos_rs__MMColParam = Request.QueryString("ProductID")
End If
%>

<%
Dim photos_rs
Dim photos_rs_numRows

Set photos_rs = Server.CreateObject("ADODB.Recordset")
photos_rs.ActiveConnection = MM_photo_STRING
photos_rs.Source = "SELECT * FROM PHOTOCOLLECTIONS WHERE ProductID = " + Replace(photos_rs__MMColParam, "'", "''") + ""
photos_rs.CursorType = 0
photos_rs.CursorLocation = 2
photos_rs.LockType = 3
photos_rs.Open()
photos_rs_numRows = 0
%>

So I understand why it will only display the one result since thats the detail page.

Is it possible to be able to scroll through the results using the previous and next buttons as I have setup in the display on the http://www.photoghetto.com/photo-images/animals-photo-detail.asp page. For example, http://www.photoghetto.com/photo-images/animals-photo-detail.asp=ProductID=6.

Since the resutls are gathered from across the database its not possible to have a href tage that does a <<< http://www.photoghetto.com/photo-images/animals-photo-detail.asp=ProductID=(6 -1) or a >>> http://www.photoghetto.com/photo-images/animals-photo-detail.asp=ProductID=(6+1).

I guess it has to be something with a recordset index but does anyone know how to do it? And does anyone have the ability to help me do it?

My boss is kicking my butt now to get this thing online at some point today, and I'm turning to you guys for help if possible.

I'm sorry if this is a stupid question. I've really ran out of ideas.

-SOM

View 9 Replies View Related

Recordset

Mar 27, 2007

is there any thing like a recordset concept in sql server,
where i could loop through and update each rows

Thanks,
MG

View 5 Replies View Related







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