| Author |
Topic |
|
Tamer
Starting Member
22 Posts |
Posted - 2008-08-21 : 02:43:08
|
| Dear Experts,,I work on Visual FoxPro 9.0 SP2 as a programming language and the SQl2005 as a database,I publish my SQL data on a V.F. formand insert,delete,update it by SQL statments written in the V.F environment.the problem I face is confirming the update in the database,In other words,I update the data on the interface of the V.F.by SQL statments,but no changes happen in the database.what do you suggest to get the changes in the original tablesin the SQL.Thanks In AdvanceTamer |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-21 : 03:37:33
|
| how are you performing update? can you post query used? |
 |
|
|
Tamer
Starting Member
22 Posts |
Posted - 2008-08-21 : 03:52:20
|
| UPDATE crsemployee SET e_name1='rafat khamaiseh' WHERE E_NO=1This statment is put in a command button on the form. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-21 : 03:54:52
|
quote: Originally posted by Tamer UPDATE crsemployee SET e_name1='rafat khamaiseh' WHERE E_NO=1This statment is put in a command button on the form.
why are hardcoding the E_NO value?the above code will always update record with E_NO =1 if any exists. Is this what you really intend? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-08-21 : 03:56:45
|
quote: Originally posted by Tamer UPDATE crsemployee SET e_name1='rafat khamaiseh' WHERE E_NO=1This statment is put in a command button on the form.
After updation run this query in Query Analyser and see if data are updatedSELECT * FROM crsemployee WHERE E_NO=1MadhivananFailing to plan is Planning to fail |
 |
|
|
Tamer
Starting Member
22 Posts |
Posted - 2008-08-21 : 04:15:55
|
| I would change the name of the e_no=1 just as a simple test to get the method of changing the name in the SQL table permenantly then I will perform more complicated operations.the problem is when I run this updata statment above by the command in the V.F. I excute this statment in the sql 2005 environmentto get no change , it keeps the old name.select * from crsemployee where e_no=1 |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-08-21 : 04:18:44
|
quote: Originally posted by Tamer I would change the name of the e_no=1 just as a simple test to get the method of changing the name in the SQL table permenantly then I will perform more complicated operations.the problem is when I run this updata statment above by the command in the V.F. I excute this statment in the sql 2005 environmentto get no change , it keeps the old name.select * from crsemployee where e_no=1
Run update query in query analyser and see if get updatedMadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-21 : 04:23:26
|
quote: Originally posted by Tamer I would change the name of the e_no=1 just as a simple test to get the method of changing the name in the SQL table permenantly then I will perform more complicated operations.the problem is when I run this updata statment above by the command in the V.F. I excute this statment in the sql 2005 environmentto get no change , it keeps the old name.select * from crsemployee where e_no=1
check if crsemployee has some trigger existing if your query didnt update correctly while running in query anlyser. |
 |
|
|
Tamer
Starting Member
22 Posts |
Posted - 2008-08-21 : 04:34:49
|
| Sorry , but how can i get the query analyser in the sql server 2005 environment.by the way , there are no triggers in the database |
 |
|
|
Tamer
Starting Member
22 Posts |
Posted - 2008-08-21 : 04:45:47
|
| I dont want to disturbe you more , if there is no solution , never mind because the problem could be in the connection between V.F. and SQL 2005 .The problem make confusion , so I prefer to think in the connection and the cursor adapter and the class created in the V.F.But I dont know what is requested to do in the SQL 2005 side to make the update success |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-08-21 : 05:10:52
|
quote: Originally posted by Tamer I dont want to disturbe you more , if there is no solution , never mind because the problem could be in the connection between V.F. and SQL 2005 .The problem make confusion , so I prefer to think in the connection and the cursor adapter and the class created in the V.F.But I dont know what is requested to do in the SQL 2005 side to make the update success
Goto management studio; in the tool bar click new query to get query analyserMadhivananFailing to plan is Planning to fail |
 |
|
|
Tamer
Starting Member
22 Posts |
Posted - 2008-08-21 : 05:21:06
|
| Okay , that already done but no change in the data |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-08-21 : 05:23:55
|
quote: Originally posted by Tamer Okay , that already done but no change in the data
does update query give some error? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-08-21 : 05:24:57
|
quote: Originally posted by Tamer Okay , that already done but no change in the data
select * from crsemployee where e_no=1UPDATE crsemployee SET e_name1='rafat khamaiseh' WHERE E_NO=1select * from crsemployee where e_no=1Also post table structureMadhivananFailing to plan is Planning to fail |
 |
|
|
Tamer
Starting Member
22 Posts |
Posted - 2008-08-21 : 08:26:50
|
| If I excute the update and select statments in the SQL2005 environment I get the result as I need , but the problem is when I write and excute the update statment in the visual F.V. ,thus it doesnt reflect on the SQL 2005 database.So the problem could be mainly with the connection.to be able to solve this you should hold enough knowlege in the V.F. connections with other data sources and the cursor adapterin additionl to the classes.therefore we should think about the problem accordingly.Thank you so much for your cooperationTamer |
 |
|
|
|