Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why cursoradapter class does not work
Message
From
09/01/2005 12:16:27
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Why cursoradapter class does not work
Miscellaneous
Thread ID:
00975501
Message ID:
00975501
Views:
54
In the following code (my first attempt to use cursoradapter()), cursorfill() method returs .F. without any error messages.
Why ?

How to get the error message ? I tried to turn odbc tracing ON
from XP control panel/Administrative Tools/ODBC data sources
but no log file is created.

Code to reproduce:
ca=NEWOBJECT('cadapter', 'cadapter.vcx')

IF !ca.cursorfill()
  MESSAGEBOX('error')
  ENDIF
cadapter.vcx cursorfill method:
lparameters tlUseCursorSchema, tlNoData, tuOptions, toSource
set multilocks on
lnConnHandle= sqlstringconnect( ;
  "DRIVER=Firebird/InterBase(r) driver; UID=SYSDBA; PWD=masterkey; " + ;
  "DBNAME=localhost:c:\mydb.fdb;")

IF lnConnHandle <= 0
  MESSAGEBOX('ODBC Connection Failed', 16, 'ODBC')
  RETURN .f.
  ENDIF
  
SQLEXEC(lnConnHandle, 'drop table klient')
lnGetData = SQLEXEC(lnConnHandle, 'CREATE TABLE KLIENT ( ' + ;
   'KOOD CHAR(12), NIMI CHAR(70), A_A CHAR(35))' )

IF lnGetData <= 0
  MESSAGEBOX('ODBC create table Failed', 16, 'ODBC')
  RETURN .f.
  ENDIF

This.DataSource = lnConnHandle

This.SelectCmd = [select klient.* from klient]
This.KeyFieldList = [KOOD]
This.UpdateNameList = "KOOD KLIENT.KOOD, NIMI KLIENT.NIMI"
This.UpdatableFieldList = "KOOD, NIMI" 
THIS.Alias = 'klient'
return dodefault(tlUseCursorSchema, tlNoData, tuOptions, toSource)
Andrus
Next
Reply
Map
View

Click here to load this message in the networking platform