473,597 Members | 2,157 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\c ustom-web-stats-
project\web-stat.mdb")
access = self.db.OpenRec ordset("select * from local_web_stat
where 1")
temp = self.db.OpenRec ordset("select * from lastid where 1")
self.lastid=tem p.Fields("lasti d").Value

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

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

access.Fields(" customer").valu e= 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_phras e"]
access.Fields(" from_server").v alue = row["from_serve r"]
access.Fields(" path_name").val ue = row["path_name"]
id = row["PageID"]
print id
g=str(id)
k=int(g)
access.Fields(" PageID").value= k
access.Fields(" server_name").v alue = row["server_nam e"]
access.Fields(" file_name").val ue = row["file_name"]

access.Update()
temp.Edit()
temp.Fields("la stid").Value=k
temp.Update()
Jun 27 '08 #1
0 1019

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

Similar topics

1
3284
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 phpMyadmin from zipped binaries. The only thing irregular thing I’m conscious of doing is unpack phpMyadmin, files and directories, directly into \Apache2\htdocs, because that was the only place I knew I could reach with the <http://localhost>...
2
7045
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 beign inserted, but only two records actually get inserted: mysql> use master; delete from data; LOAD DATA INFILE 'D:/customJobs/database setup/dbaseFourLines.csv' REPLACE INTO TABLE data FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"'...
8
5460
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 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
9
21634
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 the results in the grid. Say you filter the grid for records that have a certain condition set to "NO" (in this case a checkbox). In this scenario the search returns one result. If I then check the checkbox ("YES") and save it, I now get my message...
3
1892
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 the version PHP to 5. and the problem started. The load on the server skyrocked between 39-52. And I seriously have no idea what to do about it. This is remotedly hosted servise and there are number of connections from other websites to my...
4
2738
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 DROP/CREATE code and the LOAD FILE code are in separate .php files which I am running from my browser, but both commands are executed with mysql_query(). Don't know what I'm doing wrong, so I would appreciate any help with this. Both files run the...
0
2540
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 speed is quite variable -- sometimes really fast, sometimes quite slow, so I'm trying to identify ways to make it more consistent.
1
2841
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 with it. So, on Redhat, we have two versions of PHP - Apache uses 4.3.9, there's also a 4.4.2 that is default from command-line. 4.3.9 was installed by RPM, 4.4.2 was built from source. I can get mysql.so loaded and working fine in 4.4.2, but...
4
2992
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 with data from the database, allow the user to update it, and then display the form again with POST data. I can get the data out of the database and get the user updates back into the database, but how do I get the filled-out form back to the user...
0
7965
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8380
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8258
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
5847
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5426
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3881
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3923
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1493
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1231
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.