472,986 Members | 2,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

A weird problem (adodb + mysql)

Hi to all,

I'm using adodb for accessing mysql and postgres. My problem relies on
the mysql access.

Sometimes, when I try to execute a query (using ExecTrans method
below), I get this error:

'NoneType' object has no attribute 'cursor'

Maybe this error ocurrs not in my code, but in the mysql module. Does
anyone had had this problem?


The following is my DB connection class.

class DB:
def __init__(self, host=None, user=None, password=None,
self.host =
self.user =
self.password =
self.database =

self.bActive = True
self.bConnected = False

def OpenDB(self):

success = False
if self.bActive:
self.conn = adodb.NewADOConnection('mysql')
if not self.conn:
Log.log("Can't connecto to DB-Mysql")
success = False
else :
#Create the connection
ret = self.conn.Connect(self.host, self.user,
self.password, self.database)
if ret:
Log.log("DB-Mysql connection stablished")
success = True
success = False
print "DB connection disabled"
self.bConnected = success
return success

def Exec(self,query,simple=False):
resultado = list()

#Open a DB connection
if self.OpenDB():
Log.log("Executing Query: " + str(query))
cursor = self.conn.Execute(query)
if cursor:
while not cursor.EOF:
if not simple:
else :
#Close Cursor
resultado = None
resultado = None
return resultado

def ExecTrans(self, lQueries):

success = False
if self.OpenDB():
print "Executing Querys: " + str(lQueries)

#Begin Transaction

#Execute each query in lQueries
for query in lQueries:
if self.conn._errno != 0 :
success = False
success = True

#End of transaction
if success:

#Closing DB
return success

def TestConnection(self):
if self.OpenDB():
return True
return False

def CloseDB(self):
if self.conn.IsConnected() :

Jan 5 '06 #1
0 1572

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

Similar topics

by: Ian.H | last post by:
Hi all, I've taken on a massive project for a client recently and now I've hit some bug fixes that are required (3rd party code). and was just wondering about peoples opinions / personal...
by: skeeterbug | last post by:
hi all, i'm new to using php, adodb and pgsql. i have a need to enter data into a database. however, i can't find a web example or tutorial that explains the nuts and bolts of how this is...
by: Patrick | last post by:
I understand that with IIS5.1 on Windows XP Professional SP1, I can 1) Either set under IIS Manager-> Any specific Virtual Directory-> Configuration->Options->ASP Script timeout for all pages...
by: Bill | last post by:
Hi, I discovered adodb and is use it now in order to connect from PHP to ms Access under Windows. No problem. Is this also applicable to PHP under linux, because i get a lot of errors like:...
by: CountDraculla | last post by:
Fixing Multiple Database bug in adoDB popular data access layer for php, adoDB can support multiple databases from different provider at time, but not from same provider. what I mean is if you...
by: Tom | last post by:
I'm interested in adopting ADOdb (actually ADOdb Lite) and have a simple question that I haven't been able to quite pinpoint an answer to. I'm used to using the native mysql functions with...
by: sonasiva | last post by:
hai Iam creating website using ASP i wnts my clients to register first to vist site using username and password,,this i need to do iam getting error like this ADODB.Recordset (0x800A0BB9)...
by: Paul | last post by:
I encrypted a database field using MySQL AES_ENCRYPT() from a mysql command prompt. But I need to encrypt and decrypt at will in the php code as records are added and viewed. I can easily...
by: PCroser | last post by:
I have encountered a problem when querying a table. The query passed data into a recordset which should have resulted in many records but has returned EOF. After debugging the code the only...
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.