473,395 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Why can't use cursor.nextset() in adodbapi package?

I want use crsr.nextset() , But I got errors like following:

connStr = "Provider=MSDAORA.1;Password=jmpower;User ID=jmpower;Data Source=jmgis_agps3;Persist Security Info=True" import adodbapi
conn= adodbapi.connect( connStr )
crsr = conn.cursor()
sql = "select * from wjtmp"
crsr.execute(sql)
rec = crsr.fetchone()
crsr.nextset()

Traceback (most recent call last):
File "<interactive input>", line 1, in ?
File "C:\Python24\Lib\site-packages\adodbapi\adodbapi.py", line 711,
in nextset
rsTuple=self.rs.NextRecordset()
File "<COMObject Execute>", line 2, in NextRecordset
File "C:\Python24\Lib\site-packages\win32com\client\dynamic.py",
line 251, in _ApplyTypes_
result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags,
retType, argTypes) + args)
com_error: (-2147352567, '\xb7\xa2\xc9\xfa\xd2\xe2\xcd\xe2\xa1\xa3',
(0, 'ADODB.Recordset', 'Current provider does not support returning
multiple recordsets from a single execution.',
'C:\\WINNT\\HELP\\ADO210.CHM', 0, -2146825037), None)


Why?

thanks
Jul 18 '05 #1
4 3296
On Mon, 24 Jan 2005 17:18:05 +0800, nightmarch <ni********@gmail.com>
declaimed the following in comp.lang.python:
sql = "select * from wjtmp"
crsr.execute(sql)
rec = crsr.fetchone()
crsr.nextset()
com_error: (-2147352567, '\xb7\xa2\xc9\xfa\xd2\xe2\xcd\xe2\xa1\xa3',
(0, 'ADODB.Recordset', 'Current provider does not support returning
multiple recordsets from a single execution.',
'C:\\WINNT\\HELP\\ADO210.CHM', 0, -2146825037), None)


Why?

Could it be because you don't have multiple recordsets in crsr?

You're executing a single select statement, retrieving the
/first/ record from the result, and then trying to get a totally
different result set.

Maybe you want the next record in the record set you already
have? crsr.fetchnext()?
thanks
-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Jul 18 '05 #2
Thank you Dennis!

You mean I should execute many select statement like this " rec =
crsr.fetchall() " ?
But the result is the same, still got the error like "... 'Current
provider does not support returning multiple recordsets from a single
execution.'..."
On Mon, 24 Jan 2005 17:00:39 GMT, Dennis Lee Bieber
<wl*****@ix.netcom.com> wrote:
On Mon, 24 Jan 2005 17:18:05 +0800, nightmarch <ni********@gmail.com>
declaimed the following in comp.lang.python:
>> sql = "select * from wjtmp"
>> crsr.execute(sql)
>> rec = crsr.fetchone()
>> crsr.nextset()

com_error: (-2147352567, '\xb7\xa2\xc9\xfa\xd2\xe2\xcd\xe2\xa1\xa3',
(0, 'ADODB.Recordset', 'Current provider does not support returning
multiple recordsets from a single execution.',
'C:\\WINNT\\HELP\\ADO210.CHM', 0, -2146825037), None)


Why?


Could it be because you don't have multiple recordsets in crsr?

You're executing a single select statement, retrieving the
/first/ record from the result, and then trying to get a totally
different result set.

Maybe you want the next record in the record set you already
have? crsr.fetchnext()?
thanks


--
> ================================================== ============ <
> wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
> wu******@dm.net | Bestiaria Support Staff <
> ================================================== ============ <
> Home Page: <http://www.dm.net/~wulfraed/> <
> Overflow Page: <http://wlfraed.home.netcom.com/> <

--
http://mail.python.org/mailman/listinfo/python-list

Jul 18 '05 #3
On Tue, 25 Jan 2005 11:23:51 +0800, nightmarch <ni********@gmail.com>
declaimed the following in comp.lang.python:
Thank you Dennis!

You mean I should execute many select statement like this " rec =
crsr.fetchall() " ?
But the result is the same, still got the error like "... 'Current
provider does not support returning multiple recordsets from a single
execution.'..."
Multiple recordsets, as I understand it, implies one execute
that returns more than one "select" structure (I'm very weak on
paraphrasing this).

Your SELECT should be returning multiple /records/ in ONE
recordset. It is the multiple records you should be processing. What
follows is an excerpt from a program I have that updates a static web
page (no CGI/dynamic server available -- I have to update the database
locally, run a Python script to regenerate the web page, and upload the
web page).

I execute a SELECT, the process /all/ the returned records using
a loop on fetchall(). {TableRow() is a short function that writes the
HTML for a table data row}

# open database NOTE: NO ERROR CHECKING
myDB = MySQLdb.connect(host='localhost', user='bestiaria',
passwd='web-asst', db='bestiaria')
myC = myDB.cursor()

# get convention records occurring later than today
myC.execute("""select name, URL, banner, width, height, dates,
site, notes
from conventions
where sortdate > curdate()
order by sortdate""")

# write each to table
for aCon in myC.fetchall():
(name, URL, banner, width, height, dates, site, notes) =
aCon
TableRow(fnew, name, URL, banner, width, height, dates,
site, notes)

# repeat for convention records occurring BEFORE today
myC.execute("""select name, URL, banner, width, height, dates,
site, notes
from conventions
where sortdate <= curdate()
order by sortdate""")

# write each to table
for aCon in myC.fetchall():
(name, URL, banner, width, height, dates, site, notes) =
aCon
TableRow(fnew, name, URL, banner, width, height, dates,
site, notes)
Oh, if it means anything, that uses a DB-API compatible module,
not some M$ specific system...

-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Jul 18 '05 #4
nightmarch <ni********@gmail.com> wrote:
Thank you Dennis!

You mean I should execute many select statement like this " rec =
crsr.fetchall() " ?


No, you misunderstand. nextset() is used when you issue several SELECT
statements in a single request. The first fetchall() gets the results of
the first SELECT statement. To get the next one, you use nextset().

Your example only had one SELECT:
> >>> sql = "select * from wjtmp"
> >>> crsr.execute(sql)
> >>> rec = crsr.fetchone()
> >>> crsr.nextset()


If you are only issuing one SELECT, like most applications, then nextset()
serves no purpose. If you did something like this:

sql = "select * from wjtmp; select count(*) from wjtmp;"

That's when you need nextset(). Personally, I've never used it.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Achim Domma | last post by:
Hi, I read a webpage via urllib2. The result of the 'read' call is of type 'str'. This string can be written to disc via file('out.html','w').write(html). Then I write the string into a...
1
by: Max Ischenko | last post by:
Hi, I'm using adodbapi wrapper arount OLEDB driver and I got this error when calling adodbapi.connect(): (-2147221008, 'CoInitialize has not been called.', None, None) The weird part is that...
0
by: Max Ischenko | last post by:
I'm using adodbapi DBAPI module to access SQL server and trying to pass a GUID parameter with an SQL statement. But it doesn't work: I got "incorrect cast expression" from the ADO. If I paste GUID...
0
by: Prashanth | last post by:
I am getting this error from BEA DB2 Driver in weblogic console. java.sql.SQLException: CURSOR C02 NOT IN A PREPARED STATE java.sql.SQLException: CURSOR C02 NOT IN A PREPARED STATE We keep...
1
by: boston01 | last post by:
I am testing a database application. It works fine when only one user uses the application, however, when there are concurrent users, I saw rollbacks in event log. Can experts in this group...
2
by: Bill_DBA | last post by:
I have the following stored procedure that is called from the source of a transformation in a DTS package. The first parameter turns on PRINT debug messages. The second, when equals 1, turns on the...
0
debasisdas
by: debasisdas | last post by:
SAMPLE CODE USING RECORD =========================== declare cursor c1 is select * from dept; type drec is record (a dept.deptno%type, b dept.dname%type, c dept.loc%type); type ttype is...
5
by: jbenner | last post by:
I have opened a PMR for this with IBM, and am not asking for advice from the DB2 DBA community. I am posting this as an FYI that DB2 Health Monitor, even at the latest version of DB2, still can cause...
7
by: Jurgen Haan | last post by:
Hi there. Recently, one of our application servers is moaning about its handles. (no more handles available). I'm guessing it has to do with some bug in our software where it does not release...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.