Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Stewart Chew
  Where is Stewart Chew?
 
 Malaysia
 Stewart Chew
 Tags
Subject: Problem Update MySql Database
Thread ID: 143259 Message ID: 143259 # Views: 3 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Monday, August 27, 2007 7:40:51 AM         
   


Dear Expert,

I've problem update records, can anyone here help me? I need to update the records using INNER JOIN command, but mySql can't accept INNER JOIN function, please help.....

SELECT cSticker
DO WHILE .T.
LOCATE FOR cSticker.Unit_cost > 0 AND cSticker.upd = 1
IF FOUND()
	IF MESSAGEBOX('Update',292,'Are you sure?') = 6
	
		UPDATE cSticker SET unit_cost = mUnitCost WHERE upd = 1

		TEXT TO lcSql NOSHOW PRETEXT 15 TEXTMERGE
			UPDATE s_partcode SET unit_cost = cSticker.unit_code
				FROM s_partcode INNER JOIN cSticker ON s_partcode.part_code = cSticker.part_code
				WHERE cSticker.upd = 1
		ENDTEXT

		IF SQLPREPARE(oConn, lcSql) < 0
			AERROR(laError)
			MESSAGEBOX(laError[1,2])
		ENDIF

		IF SQLEXEC(oConn) < 0
		   AERROR(laError)
		   MessageBox(laError[1,2])
		   EXIT
		ENDIF
	ENDIF
	EXIT
ELSE
	WAIT WINDOWS [Invalid choice]
	EXIT
ENDIF
ENDDO




Regards,

Stewart Chew

ENTIRE THREAD

Problem Update MySql Database Posted by Stewart Chew @ 8/27/2007 7:40:51 AM
RE: Problem Update MySql Database Posted by Jefferson Aguilar @ 8/27/2007 12:46:09 PM