473,403 Members | 2,323 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,403 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 1011

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
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?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.