Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Upating a Field in a mysql table

Status
Not open for further replies.

jcarneir

Programmer
May 17, 2001
26
0
0
VE
Hi,

Somedays ago, I had a sql server table.

My code were somthing like:

set rst= db.openrecordset("SomeSqlServerTable")

while not rst.eof
if SomeCondition then
rst.edit
rst!SomeField="SomeValue"
rst.update
endif
rst.movenext
wend

Today, the table is in mysql but this code is very slow (maybe the odbc is the problem).

I'm thinking about migrate the code to mysql and I have not found the rst.edit manipulatefield rst.update equivalents.

Some clue???
 
good one ;-)

check the UPDATE syntax in mysql docs

and to the speed problem - I've run once into similar situation and it turned out as a dns problem - specify fqdn in the host fields in the authentication tables, maybe it hepls you as it did in my case
 

You can probably do it all in an Update query. Your speed problem is in looping through a recordset. As we don't know which version of MySQL you are using and we can't be sure if you are using VB or ASP to access it we can't be very specific, but your Update statement will look SIMILAR to
Code:
Update myTable Set SomeField = 'SomeValue' Where SomeCondition
You then need to find the appropriate syntax to execute a SQL statement on your connection object in ASP/VB as appropriate

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top