trying to update a test simple SQL  table using CursorAdapter class from VFP9
  I am always getting -1 value in aUpdateinfo after TBALEUPDATE command
   
  here is my code:
  _________________________________________
  ******************************************************************************
  * SQL table MWTEST contains the following fields
  * CUST_ID N(14,0), Name_first varchar(15), name_last varchar(25)
  *
  
*******************************************************************************
  lodo = CreateObject("CursorAdapter")
lodo.DataSourceType="ODBC"
  LOCAL lcSQLSrvType,lcSQLSrvName,lcUserid,lcPassword,lcDB  
    lcSQLSrvType=[SQL SERVER]  
  lcSQLSrvName=[HAIDAR-JEAN-J\SQLEXPRESS_JH] 
  lcUserid=[]
  lcPassword=[] 
  lcDB=[MYTESTDB]
  
lcConStr= 
[uid=]+lcUserid+[;pwd=]+lcPassword+[;server=]+lcSQLSrvName+[;driver=]+lcSQLSrvType+[;database=]+lcDB+[;DSN='';Trusted_Connection=Yes]
    
  lodo.DataSource=SQLStringConnect(lcConStr)
lodo.alias=[crsmwtest]
  lnCust_ID=[12345678901234]
lodo.SelectCmd="select * from mwtest where cust_ID= " + ALLTRIM(lnCust_ID)
  
*-- this working fine, crsmwtest cursor is open
lodo.CursorFill()
   
  *- update
  lodo.ALLOWUPDATE = .T.
lodo.ALLOWinsert = .T.
lodo.ALLOWDELETE=.T.
lodo.tables=[MWTEST]
  lodo.KeyFieldList = "CUST_ID"
lodo.UpdatableFieldList="name_first,name_last"
lodo.UpdateNameList="name_first MWTEST.name_first, name_last MWTEST.name_LAST"
  
lodo.WHERETYPE = 3 && key and modified fields
       
lodo.UPDATECMD=[]

  *-- aUpdateinfo is populated with -1     
lSaved = TABLEUPDATE(2, .F., 'Crsmwtest', aUpdateInfo)

   
  *------------------------------------------------------------------
   
  * I also tried populating populating .UPDATCMD as follows
  * But still no Luck
  * Cannot get the Tableupdate to work???
   
   
  lodo.KEYFIELDLIST = []
lodo .TABLES = []
lodo.UPDATABLEFIELDLIST = []
lodo.UPDATENAMELIST = []
   
  *-- not working  ( aUpdateInfo =-1)
  lnCust_ID=lnCust_ID=[12345678901234]

lodo.UPDATECMD = [update MWTEST SET ] ;     
     + [name_last   = "ZZZZ" ]      
     + [where cust_ID= ] + ALLTRIM(lnCust_ID)
   
  *-- this is not working (aUpdateInfo =-1)
*!* lodo.UPDATECMD = [update MWTEST SET ] ;     
*!*      + [name_last   = ?RTRIM(crsMWTEST.name_last) ] ;
*!*      + [where CUST_ID = ?crsMWTEST.CUST_ID]
  

   
   
  how can I find out why is causing TABLEUPDATE to fail?
   
  HELP!
   
   
   
   
   
   
   
   
   
   


--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to