472,357 Members | 2,041 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

cannot load index value from mysql database

Hi

I am trying to right a script to keep a local copy of my mysql
database in a local access file. I was able to do this in Access
visual basic, but cannot get it to work in python.

The procedure works by storing the last index value after each
update. Then I do a quarry for all records with a index value bigger
the the last one stored.

In python when I try to get the index value, ID it gives me a
keyword. I know the firled exist because I am doing the following
querry
Here is the code,
Help!!!!!!

engine = win32com.client.Dispatch("DAO.DBEngine.36")
self.db=engine.OpenDatabase(r"w:\consulting\custom-web-stats-
project\web-stat.mdb")
access = self.db.OpenRecordset("select * from local_web_stat
where 1")
temp = self.db.OpenRecordset("select * from lastid where 1")
self.lastid=temp.Fields("lastid").Value

#open mysql
conn = MySQLdb.connect ("……….")
cursor = conn.cursor (MySQLdb.cursors.DictCursor)
cursor.execute ("SELECT * FROM web_stat where
ID>"+str(self.lastid))
result_set = cursor.fetchall ()

for row in result_set:
last=row["ID"]b (this does not work why???????)
access.Edit()

access.Fields("customer").value= row["customer"]
t=row["time"]
print t

access.Fields("Time").value=t
access.Fields("phrase").value= row["phrase"]
access.Fields("key_word_phrase").value =
row["key_word_phrase"]
access.Fields("from_server").value = row["from_server"]
access.Fields("path_name").value = row["path_name"]
id = row["PageID"]
print id
g=str(id)
k=int(g)
access.Fields("PageID").value=k
access.Fields("server_name").value = row["server_name"]
access.Fields("file_name").value = row["file_name"]

access.Update()
temp.Edit()
temp.Fields("lastid").Value=k
temp.Update()
Jun 27 '08 #1
0 945

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

Similar topics

1
by: Kevin | last post by:
I posted this to the sourceforge phpMyAdmin ng, but there was a comment that it was properly a php question, so I'm posting it here. I'm on Windows XP, and have just installed Apache, php 5, and...
2
by: Alex Hunsley | last post by:
I'm using a mysql monitor under cygwin (on win xp) to do a 'load data infile' to put some data into a mysql database (I'm using the xampp bundle).. My problem is that I have a four line CSV file...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
9
by: John Kirksey | last post by:
I have a page that uses an in-place editable DataGrid that supports sorting and paging. EnableViewState is turned ON. At the top of the page are several search fields that allow the user to filter...
3
by: ewunia | last post by:
I am running the tagboard service on my server. Few months ago I bought the new dedicated server with Dual Xeon 3.2 GHz and 2GB Ram. The board is written in PHP with Mysql. Not long ago I updated...
4
by: CPD | last post by:
From PHP, doing a DROP TABLE and a CREATE TABLE is successful, but doing a LOAD FILE keeps failing, with the error "Access denied for user 'db_user'@'localhost' (using password: YES)". The...
0
by: pcosway | last post by:
(originally posted in database.myodbc by mistake) I'm trying to speed up a fulltext search (MySQL 5.0.21, table has 670,000 records, about 900MBytes, machine has 1GB memory). Fulltext search...
1
by: edfialk | last post by:
Hi all, I'm desperately trying to get a simple mysql connection working in php 4.3.9 and I think I have a doozy for you guys. First of all, I didn't set up ANY of this system, I'm just working...
4
by: dac | last post by:
I am quietly going insane on this project. I've never worked on a project like this one before. All my previous sticky forms were for data entry, not editing. I don't know how to display the form...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

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.