Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: tushar
  Where is tushar?
 Panaji
 India
 tushar
 To: Farid Gohar
  Where is Farid Gohar?
 Berlin
 Germany
 Farid Gohar
 Tags
Subject: RE: new records are not saved on MySQL
Thread ID: 232058 Message ID: 232067 # Views: 36 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Friday, June 19, 2009 12:23:30 PM         
   


> Hello dear experts....
> I am tired....
>
> I have the following code and have granted all privileges to the user "root", but after executing the command
> k=SQLEXEC( ein_wert,"insert into tst (nam,famil) values ('jack', 'mueller')")
> i brow the table and see that no record are added to the table.
> I try using append blank, the records are created, but after quitting and restating the foxpro, the records are lost !!!!
>
> PUBLIC ein_wert
> SET MULTILOCKS ON
> ein_wert=SQLSTRINGCONNECT('dsn=erstes_DS; uid=root;pwd=einkennwort')
> lc=CREATEOBJECT("Cursoradapter")
> k=SQLEXEC(ein_wert,"use first_db")
> lc.Alias ="javan"
> lc.DataSourceType ="ODBC"
> lc.DataSource = ein_wert
> lc.Tables = "tst"
> lc.WhereType = 3
> lc.KeyFieldList = "nam"
> lc.SelectCmd = " select * from tst "
> lc.allowinsert = .t.
> aaa=lc.CursorFill()
> xxx= CURSORSETPROP('WhereType',3,"javan")
> xxx= CURSORSETPROP('Tables',"tst","javan")
> xxx= CURSORSETPROP('KeyfieldList',"nam","javan")
> xxx= CURSORSETPROP('UpdateType',2,"javan")
> xxx= CURSORSETPROP("Buffering", 5, "javan")
> xxx= cursorsetprop("SendUpdates", .t., "javan")
> xxx =cursorsetprop("BatchUpdateCount", 5, "javan")
> xxx =cursorsetprop("UpdateNameList", "", "javan")
> xxx =cursorsetprop("UpdatableFieldList", "", "javan")
> xxx =cursorsetprop("UpdateNameList", "", "javan")
> k=SQLEXEC( ein_wert,"insert into tst (nam,famil) values ('jack', 'mueller')")
> SELECT javan
> lc.CURSORREFRESH()
> fffff = TableUpdate( 0, .F., "javan" )
> dd=SQLCOMMIT(lc.DATASOURCE)
> dd=SQLDISCONNECT( lc.DATASOURCE )
> lc = NULL
> CLEAR ALL
> FLUSH FORCE
> RETURN
After
k=SQLEXEC( ein_wert,"insert into tst (nam,famil) values ('jack', 'mueller')")

check the value of k. If it is less than 0, use AERROR to see why the update did not take place.

Why are you using SendUpdates and then setting UpdatableFieldList and UpdateNameList to blank.

Regards
Tushar



COMPLETE THREAD
new records are not saved on MySQL Posted by Farid Gohar @ 6/19/2009 11:21:46 AM
RE: new records are not saved on MySQL Posted by tushar @ 6/19/2009 12:23:30 PM
RE: new records are not saved on MySQL Posted by Farid Gohar @ 6/19/2009 12:26:07 PM
RE: new records are not saved on MySQL Posted by Anders Altberg @ 6/19/2009 12:42:02 PM
RE: new records are not saved on MySQL Posted by Farid Gohar @ 6/19/2009 1:03:24 PM
RE: new records are not saved on MySQL Posted by tushar @ 6/19/2009 1:08:28 PM