DB_E_ROWSNOTRELEASED ADO2.81 Recodset-&&>Seek() After Recordset&&>Update()

May 11, 2006

I am getting error 0x80040E25 when I try to call seek after update on a Recordset opened as (adOpenStatic, adLockOptimistic, adCmdTableDirect)

9 - (13.250) - <2> - *** error in .DbRecordset.cpp, line 908
10 - (13.250) - <2> - ADO_ERRORS FOR pRs = 200a420, seek, err=-2147217883(80040e25)
11 - (13.250) - <2> - ADO_ERROR: E R R O R 1 of 1.
12 - (13.250) - <2> - ADO_ERROR: DESCRIPTION: All HROWs must be released before new ones can be obtained. [,,,,,].
13 - (13.250) - <2> - ADO_ERROR: NUMBER: 80040E25
14 - (13.250) - <2> - ADO_ERROR: NATIVE_ERROR: 0
15 - (13.250) - <2> - ADO_ERROR: SOURCE: Microsoft SQL Server 2005 Mobile Edition OLE DB Provider


I registered SQL Mobile 3.0 dlls using regsvr32.exe so now I can connect to SQLCE3.0 databases on desktop using plain ADO with such connection string _T("Provider=Microsoft.SQLSERVER.MOBILE.OLEDB.3.0; Data Source=") + name of the file

I have not asked this question before as it did not make sense -> there was no official SQLCE3.0 support on desktop. Now, since SQL CE is promiced to be supported on desktop as SQL/E I decided to ask.

View 1 Replies


ADVERTISEMENT

Recodset Destination Problem

Oct 25, 2007

Hi,

I create data flow task to retrieve my data row by row so I used Recordset Destination to put my data into a variable. I have 10,000 rows of data and when I executed the data flow :
Test One : I executed it in my computer using RAM 2Gb and it still running for over 30 minutes then I stopped it.
Test Two : I executed it in my server using RAM 2Gb and it finished for 25 minutes.
Test Three : I executed it in my 64bit server using RAM 4Gb and it still running for over 30 minutes then I stopped it.
Test Four : I executed it in my computer again and it finished for 2 seconds. Don't believe it. Run it again and same result.
I confused with this Recordset Destination. I have some questions around it :
1. What's the prerequisite using it ?
2. Why my computer had different experience when executing this package ? same specification different result. The last one is more faster than the first.
3. Can we use Recordset Destination to retrieve data more than a million rows ?

Thanks in advance,
Best regards,

Hery

View 1 Replies View Related

How To Get Identity Field Value After Recordset Update

May 19, 2004

I want to add a record and then get the automatically generated identifier(ReqChildID in this case). Is there a better way? Why won't this one work.

This is what I have:

rsRec.AddNew
rsRec("RequisitionID") = intReqNum
rsRec("CreatedBy") = cint(session("empno"))
rsRec("DateCreated") = Now
rsRec.Update
intItemId = rsRec("ReqChildID")
rsRec.Close


Forgive me if this has already been posted, but I couldn't find it.

[edit to add:]

rsRec is an ADODB.Recordset in case that wasn't clear.

View 10 Replies View Related

Error Message With Recordset.Update

Feb 9, 2007

Hi,

I am converting a VB6 application to C# using ADO. I have the following code:

private ADODB.Connection cn = new ADODB.Connection();
private ADODB.Recordset rs = new ADODB.Recordset();

private connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data source= " + stdDir;
strClientSQL = "SELECT * FROM Client ORDER BY casename, renldate, product, fundingcode";

cn.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
cn.Open(Utilities.connectionString,null,null,0);

rs.CursorLocation = ADODB.CursorLocationEnum.adUseServer;
rs.Open(strClientSQL,cn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic,-1);
rs.Fields["CaseName"].Value = this.txtCaseName.Text;

rs.Fields["CaseNo"].Value = this.txtCaseNumber.Text;

rs.Update();

When I try to compile and run it I get the following error message:
"No overload for method 'Update' takes '0' arguments"



I am not sure if I need to enter information in the update command or do something else. This seems pretty straight forward but I can't figure out how to do it. Can someone please help me?



Thanks,



Mark

View 4 Replies View Related

Recordset.update With SQL Native Client Doesn't Work

Dec 4, 2006

We recently migrated from SQL Server 7 to SQL Server 2005. Now there's a curious thing with some legacy applications. I have pasted some code below. Don't judge me, because like I said, it's legacy.

You can see, that I have two connection strings. One is commented and accessing via SQL Native Client. The other one is doing this through the old SQL Server driver. Funnily enough, when I use the new Native Client driver, the exception "Run-time error '-2147467259 (80004005)' [Microsoft][SQL Native Client]Invalid attribute value" is thrown in the rsPorder2.Update line. With the old driver, this works just alright.

Is this a bug? Is there a way, to make the code run, because we don't want to search the whole application for other occurances, if not necessary.

Any insights would be greatly appreciated.

Best regards,
DD

Dim ilinx As New ADODB.Connection
Dim rsPorder As New ADODB.Recordset
Dim rsPorder2 As New ADODB.Recordset
Dim cmdLinx As New ADODB.Command
Dim strConn As String

Dim lvIli_number As String

'strConn = "DRIVER=SQL Native Client;Server=10.0.14.7;Description=Test2k;UID=sa;PWD=asdf;APP=Microsoft® Access;WSID=DEHHC023;DATABASE=Linx;Network=DBMSSOCN;"

strConn = "DRIVER=SQL Server;Server=10.0.14.7;Description=Test2k;UID=sa;PWD=asdf;APP=Microsoft® Access;WSID=DEHHC023;DATABASE=Linx;Network=DBMSSOCN;"
ilinx.Open strConn
Set cmdLinx.ActiveConnection = ilinx

lvIli_number = "12345"
cmdLinx.CommandText = "SELECT * FROM porder WHERE previous_ili_no = '" & lvIli_number & "' "
cmdLinx.CommandType = 1

rsPorder.Open cmdLinx, , 1, 1

If rsPorder.EOF Then

cmdLinx.CommandText = "SELECT * FROM porder WHERE ili_no = '" & lvIli_number & "' "
cmdLinx.CommandType = 1
rsPorder2.Open cmdLinx, , 1, 3

If rsPorder2.RecordCount > 0 Then

rsPorder2("Locked") = 0
rsPorder2.Update
End If

End If
rsPorder.Close

View 7 Replies View Related

VB6 Recordset Update Method Fails On SQL 2005 Server

Jan 13, 2008

Hi to all....

I'm new on this forum, but, I'm a experienced programmer.
I wanna solve this problem (if you can helpme....), recently, I'm trying to migrate an old SQL 7 to the new SQL 2005 server enterprise edition, I have no problem to import the data, users, stored procedures, etc. and all work fine, I can connect troght ODBC from the others computers, including some older pentium 1 mmx 200 mhz. with WIN98 (yes!).

My problem is an legacy VB6 application that work (well fine) with SQL7 server, but, when i change the odbc of the desktops systems to the new 2005 SQL server and run this legacy application hi recibe this error:
(english translation from spanish language)

[ODBC SQL Server Driver][SQL Server] The table to be modified is not included on this cursor or these can't be modified throught this cursor.

I have look on the source code of the legacy application, and someone of the segment's that causes error is:

------------------------------------------------------------------------


Public Function ConsultaCamara(sRutOP As String, _
sRut1 As String, _
strConsulta As String, _
Tipo As String, _
chk As CheckBox, _
Timer1 As Timer, _
LbAviso As Label) As Long
'----------------------------
Dim rsCACH, rsCACH_upd0, rsCACH_upd1, rsCACH_upd2 As ADODB.Recordset
Dim CmCACH As ADODB.Command
Dim lPendiente As Boolean
Dim lActivo As Boolean
Dim strSQL1, strSQL_upd0, strSQL_upd1, strSQL_upd2 As String
Dim StrWHE As String
Dim DameTiempo As Integer
Dim snombre As String
Dim sMsgEstado As String
Dim sAviso_Inicial As String
Dim cNum As String
Dim cDig As String
...
...
...
'Defino el string de consulta
strSQL1 = " SELECT RUTOPERADOR, " & _
" IDCAMARA, " & _
" RUTCONSULTADO, " & _
" ESTADO, " & _
" CANCON, " & _
" CADENACONSULTA, " & _
" FINGRESO, " & _
" FULCONSINT, " & _
" ULTRUTOP " & _
" FROM BOLETIN " & _
" WHERE RUTCONSULTADO = '" & sRut1 & "'" & _
" AND (ESTADO = 'PE' OR ESTADO = 'AC' )"

Set rsCACH = CreateObject("ADODB.Recordset")
rsCACH.ActiveConnection = cn
rsCACH.CursorType = adOpenKeyset
rsCACH.LockType = adLockOptimistic
rsCACH.Open strSQL1
If rsCACH.EOF Then 'No hay registro antiguo o en consulta, creo uno para consultar
sMsgEstado = "NO Existen datos ES REGISTRO NUEVO" & vbCr
rsCACH.AddNew
ConsultaCamara = GeneraID()
rsCACH.Fields("IDCAMARA") = ConsultaCamara
rsCACH.Fields("RUTOPERADOR") = sRutOP
rsCACH.Fields("RUTCONSULTADO") = sRut1
rsCACH.Fields("ESTADO") = "PE"
rsCACH.Fields("CANCON") = 1
rsCACH.Fields("CADENACONSULTA") = strConsulta
rsCACH.Fields("FINGRESO") = GetDateTime() 'Format(Date, "Short Date")
rsCACH.Fields("FULCONSINT") = GetDateTime() 'Format(Date, "Short Date")
rsCACH.Fields("ULTRUTOP") = sRutOP
rsCACH.Update <----- here's launches the error
...
...
...

--------------------------------------------------------

As you see, I'm not english spokeman, I hope that you understand me.

Thanks and best regards.

View 3 Replies View Related

How Can I Get Vb6 To Update Offline Recordset When View Has Defined An Attribute As AdFldUnknownUpdatable?

Aug 21, 2006

hopefully, someone has already solved this problem

I have been assigned an application that maps data from access databases into a view in Sql Server 2005. A vb6 application does a select on the view. The recordset is then modified by the application, and eventually, the original tables will be updated with the new data. Some of the fields in the view are the result of calculations ( i.e. adding multiple varchar fields together to produce one complex varchar result ). Any of the fields that are calculated in the manner previously described have the adFldUnknownUpdatable bit set in the attributes of the recordset, and consequently, you get a -2147217887 error ( multiple-step operation .... ) when you try to change the value of the field in the recordset. Does anyone know how to get around this problem?

View 1 Replies View Related

IRowsetIndex()::Seek In SQL CE

Jul 30, 2007

Dear All,

I'm working in eVC++3.0 with SQL CE2.0.

I've developed the application to fetch the data from the mdf file by passing the index field and using the command IRowsetIndex()::Seek.
Consider TableExample with Columns A,B,C,D and index Index1 with column A and Index2 with column B,C,D.
Its working fine when index1 is passed for the indexvalue.But when i pass index2 of the same table,its throwing the error as BADINDEX.

I'm passing the correct keyvalues in the Seek command also.

Kindly help me in this regard.

Regards,
Sasi.

View 1 Replies View Related

How To Get Index Seek

May 7, 2008

Hi,

Can I use index seek and still keep 'like' 'or' functionality for the following statement?



--prepare test table

create table entity (Id int identity(1,1), FamName varchar(200), LastName varchar(200))
go
create clustered index entity_id on entity (id)
go
create nonclustered index entity_lastName on entity (lastName)
go
insert into entity select famName,FirstName from table

--test index

declare @LastName varchar(10)
set @LastName = 'a'

select FamName
from entity
where @LastName is null or LastName like @LastName --clustered index scan

View 11 Replies View Related

Index Seek Vs Scan

Nov 4, 2002

I have created a nolock view off a table to prevent locks. I have users coming in through MS Access that have switched their queries to run against the views. Now we are noticing that queries that used to run as a clustered index seek against the table are running as a clustered index scan against the table and performance in the queries has dropped.

Is there any way that the same query that hits the view instead of the table can be made to run faster or at least use the index seek?

Thanks,

Steve

View 4 Replies View Related

Seek To Find A Table

May 18, 2006

Hello I want to seek and find the table named NewCustomer from the database so what would be the query ?

F16 LĂ?GHTĂ?NĂ?NNNG

View 2 Replies View Related

Seek In A SQL Table From Access

Dec 20, 2006

I have an MS Access 2003 database from which I want to seek a specific record in a SQL Server Express 2005 database. I can connect to the table and get a recordcount but the recordset.supports (adseek) and recordset.Supports(adIndex) both return false. Any suggestions? Specific code I'm using is as follows:

Dim cnxn As ADODB.Connection
Dim strCnxn As String
Set cnxn = New ADODB.Connection
cnxn.Provider = "sqloledb"
strCnxn = "Data Source=SERVERSQLEXPRESS2005;Initial Catalog=RAMPSQL;Integrated Security='SSPI';"

cnxn.Open strCnxn

Set rsWSC = New ADODB.Recordset
rsWSC.CursorLocation = adUseServer
strSQL = "DailyData"
rsWSC.Open strSQL, cnxn, adOpenKeyset, adLockReadOnly, adCmdTableDirect


Thank you!

View 5 Replies View Related

Slowly Seek In Access

Nov 30, 2006

Hi

I have a frontend Access and backend SQL
works fine but when i in my customer table seek in name
it takes very very long time . I use ODBC to my connection

is there anayway to this better.?



regards

alvin

View 3 Replies View Related

Seek Help To Understand The Jet Database Engine

Oct 4, 2007

Hi,

I am reading the book by Steven Roman:

"Access Database : Design and Programming" 3rd edition.

On page 120, Figure 7-2, he showed the the structure of the Jet Database Engine, which is very confusing to me.

According to this picture, I come to such an understanding:

1) VBA is just the hosting language for the Jet Database Engine;

2) Microsoft Visual Basic, Excel, Access, Word are hosting languages for VBA.

Isn't this weird? VB hosts VBA?

Thanks for any input!

View 1 Replies View Related

Optimize Query - How To Make It An Index Seek

Jun 21, 2004

create table t1(a varchar(50) , b varchar(50))

create index i1 on t1(a)
create index i2 on t1(b)

create view v1
as
select * from t1 where isnull(a,b) = 'test'

select * from v1

The above SQL "select * from v1" is doing a table scan.
What do I do to make it perform an index seek ????

TIA

- ForXLDB

View 11 Replies View Related

Seek Table Column In Stored Procedure

Dec 13, 2007

Hi All,

The script below may be use to find out what stored procedure uses a specified column from any of the table. This could be helpful in cases you have change a field name of a table and want to find out what stored procedure uses that column.

create procedure seek_sp_for_columns
@colname_para varchar(500)

as

begin
create table #temp_t
(
textcol varchar(1000)
)

create table #temp_t2
(
procname varchar(500)
)

declare @procname as varchar(500)
declare @found as int
declare @colname as varchar(500)
declare @valid_colname as int


select @valid_colname = count(id)
from syscolumns
where name = @colname_para

if (@valid_colname > 1)
begin
set @colname = '%' + @colname_para + '%'



declare sp_cursor cursor
for select name
from sysobjects
where xtype = 'P'

open sp_cursor

fetch next from sp_cursor
into @procname

while @@fetch_status = 0
begin
insert into #temp_t
exec sp_helptext @procname

set @found = 0
select @found = count(textcol)
from #temp_t
where textcol like @colname

if (@found > 0)
begin
insert #temp_t2 values(@procname)
end

delete #temp_t

fetch next from sp_cursor
into @procname
end

close sp_cursor
deallocate sp_cursor


select *
from #temp_t2

drop table #temp_t
drop table #temp_t2
end
else
begin
select 'Please verify column name'
end

end

View 2 Replies View Related

Seek Method, Table-direct, And Sql Server2005

Jul 23, 2005

From what I've read in the docs, ado.net currently supports opening sqlserver ce tables in table-direct mode and performing Seek operations on them(using SqlCeDataReader), but not on the full-blown sql server. Is this(will this be) still true with ado.net 2.0 & sql server 2005?

View 11 Replies View Related

Northwind - Execution Plan Bug? Why Index Seek And No Bookmark Lookup?

Dec 10, 2006

If you display the execution plan and run the following:SET STATISTICS IO ONgoSELECT ProductID, SupplierIDFROM ProductsWHERE SupplierID = 1I don't understand how come there is noBookmark Lookup operation happening to get theProductID?I only see an Index Seek happening on SupplierID.There is no composite index SupplierID + ProductIDso what am I not understanding here?Thank you

View 3 Replies View Related

SQL Server 2014 :: Memory-optimized Queries Using Table Scan Instead Of Seek?

Sep 19, 2015

I've been having some trouble getting a single-column "varchar(5)" field to reliably use a table seek instead of a table scan. The production table in this case contains 25 million rows. As impressive as it is to scan 25 million rows in 35 seconds, the query should run much faster.

Here's a partial table description:

CREATE TABLE [dbo].[Summaries_MO]
(
[SummaryId] [int] IDENTITY(1,1) NOT NULL,
[zipcode] [char](5) COLLATE Latin1_General_100_BIN2 NOT NULL,
[Golf] [bit] NULL,
[Homeowner] [bit] NULL,

[Code] .....

Typically, this table is accessed with a query that includes:

SELECT ...
FROM SummaryTable
WHERE ixZIP IN (SELECT ZipCode FROM @ZipCodesForMO)

This query insists on using a table scan. I've tried WITH (FORCESEEK) for example, but that just makes the query fail.

As I've investigated this issue I also tried:

SELECT * FROM Summaries WHERE ZipCode IN ('xxxxx', 'xxxxx', 'xxxxx')

When I run this query with 64 or fewer (actual, valid) ZIP codes, the query uses a table seek.But when I give it 65 or more ZIP codes it uses a table scan.

To summarize, the production query always uses a table scan, and when I specify 65 or more ZIP codes the query also uses a table scan. I'm wondering if the data type of the indexed column (Latin1_General_100_BIN2) is somehow the problem. I'll likely try converting the ZIP codes to an integer to see what happens.

View 9 Replies View Related

Difference Between Index Seek &&amp; Index Scan &&amp; Index Lookup Operations?

Oct 20, 2006

please explain the differences btween this logical & phisicall operations that we can see therir graphical icons in execution plan tab in Management Studio

thank you in advance

View 3 Replies View Related

Index Scan Vs Index Seek

Mar 1, 2004

I have a really strange problem.

I execute this query:

declare @cid int
set @cid = 2003227

select * from sales s, product p where p.product_Id = s.product_Id and customer_id = @cid

select * from sales s, product p where p.product_Id = s.product_Id and customer_id = @cid or @cid = 0

3 Million rows in sales, 120000 in product.

The first does and index seek, the second an index scan.
The execution plan reports that the scan takes 99.87% of the cost, and the seek takes 0.13%

This problem obviously gets worse the bigger the dataset / query /etc.

The reason I query this, is because it never used to take this long to do index scans. Is there something i can change, something i can fix?

Any help would be appreciated.

Josh

View 2 Replies View Related

Simple Query Chooses Clustered Index Scan Instead Of Clustered Index Seek

Nov 14, 2006

the query:

SELECT a.AssetGuid, a.Name, a.LocationGuid
FROM Asset a WHERE a.AssociationGuid IN (
SELECT ada.DataAssociationGuid FROM AssociationDataAssociation ada
WHERE ada.AssociationGuid = '568B40AD-5133-4237-9F3C-F8EA9D472662')

takes 30-60 seconds to run on my machine, due to a clustered index scan on our an index on asset [about half a million rows].  For this particular association less than 50 rows are returned. 

expanding the inner select into a list of guids the query runs instantly:

SELECT a.AssetGuid, a.Name, a.LocationGuid
FROM Asset a WHERE a.AssociationGuid IN (
'0F9C1654-9FAC-45FC-9997-5EBDAD21A4B4',
'52C616C0-C4C5-45F4-B691-7FA83462CA34',
'C95A6669-D6D1-460A-BC2F-C0F6756A234D')

It runs instantly because of doing a clustered index seek [on the same index as the previous query] instead of a scan.  The index in question IX_Asset_AssociationGuid is a nonclustered index on Asset.AssociationGuid.

The tables involved:

Asset, represents an asset.  Primary key is AssetGuid, there is an index/FK on Asset.AssociationGuid.  The asset table has 28 columns or so...
Association, kind of like a place, associations exist in a tree where one association can contain any number of child associations.  Each association has a ParentAssociationGuid pointing to its parent.  Only leaf associations contain assets. 
AssociationDataAssociation, a table consisting of two columns, AssociationGuid, DataAssociationGuid.  This is a table used to quickly find leaf associations [DataAssociationGuid] beneath a particular association [AssociationGuid].  In the above case the inner select () returns 3 rows. 

I'd include .sqlplan files or screenshots, but I don't see a way to attach them. 

I understand I can specify to use the index manually [and this also runs instantly], but for such a simple query it is peculiar it is necesscary.  This is the query with the index specified manually:

SELECT a.AssetGuid, a.Name, a.LocationGuid
FROM Asset a WITH (INDEX (IX_Asset_AssociationGuid)) WHERE
a.AssociationGuid IN (
SELECT ada.DataAssociationGuid FROM AssociationDataAssociation ada
WHERE ada.AssociationGuid = '568B40AD-5133-4237-9F3C-F8EA9D472662')

To repeat/clarify my question, why might this not be doing a clustered index seek with the first query?

View 15 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

Recordset

Nov 23, 2005

This asp code displayes records in a combo box:<%openDB()call updateDB("usp_retrieveOptions",rs)if not rs.eof then%><tr><td width="66">Options</td><td width="137"><select name="select1" class="TextField1"><%i = 0do while not rs.eofif rs(0) <> Arr(i) thenresponse.write "<option value=" & rs(0) & ">" & rs(1)i = i + 1end ifrs.movenextloop%></select></td></tr><tr><td colspan="2" width="206"><center><table width="71" border="0" cellspacing="3" cellpadding="0"height="33"><tr><td width="9" height="30"><input type="submit" name="Assign" value="Assign"></td></tr></table></center></td></tr><%end ifcloseRS()closeDB()%>The call updateDB("usp_retrieveOptions",rs) invokessub updateDB(SQL,rs)set rs = objConn.Execute(SQL)end suband my usp_retrieveOptions stored procedure:create procedure usp_retrieveOptionsAS SET NOCOUNT ONSELECT OptionID, Description FROM OptionsReturnGOnow in my asp code when I try response.write rs.RecordCount I am getting-1 all the time. How do I solve the problem. Your help is kindlyappreciated.Eugene Anthony*** Sent via Developersdex http://www.developersdex.com ***

View 4 Replies View Related

How To Use A Value From One Recordset In Another..?

Jul 20, 2005

Im doing a select that should retrieve a name from one table and display thenumber of correct bets done in the betDB (using the gameDB that has info onhow a game ended)I want the "MyVAR" value to be used in the inner select statement withouttoo much hassle. As you can see im trying to get the "MyVAR" to insert inthe bottom line of the code.Whats the quick fix to this one..?Thanks in advance :-)---------- code begin ----------select memberDB.memberID as MyVAR, (select count(GamesDB.GameID)from GamesDBinner join GameBetDBon GameBetDB.betHome = GamesDB.homeGoal and GameBetDB.betAway =GamesDB.awaygoalinner join memberDBon memberDB.memberID = GameBetDB.memberIDwhere GamesDB.gameID=GameBetDB.gameIDand GameBetDB.memberID= MyVAR ) as wins from memberDB---------- code end ----------

View 1 Replies View Related

How Do I Declare A Recordset ?

Aug 25, 2006

Hi allHow do i declare a recordset and fetch records from an sql server?TIAGuy

View 3 Replies View Related







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