Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SPT, 2 handles: how to set up updatable grid
Message
From
06/04/2005 14:01:25
 
 
To
01/02/2005 17:29:28
James Blackburn
Qualty Design Systems, Inc.
Kuna, Idaho, United States
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00981560
Message ID:
01002023
Views:
46
Help me with this. I do not know what does this do?


>
>function makeupdate()
>text to lcSql textmerge noshow pretext 7
>update (col1,col2)
>values (<<addQuotes(col1)>>,<<col2>>)
>where tablepk = <<tablepk>>
>endtext
>return lcSql
>endfunc
>
>FUNCTION addQuotes(tcString)
>	LOCAL lcRet
>	IF TYPE(tcString) == "C"
>		IF EMPTY(tcString)
>			lcRet = "null"
>		ELSE
>			lcRet = STRTRAN(tcString,"'","''")
>			lcRet = "'"+ALLTRIM(lcRet)+"'"
>		ENDIF
>	ELSE
>		lcRet = NVL(tcString,'null')
>	ENDIF
>	return lcRet
>ENDFUNC
>
>
>
>>The 3rd cursor is created with a basic SELECT statement (not SQLEXEC with handle)? How do I make this 3rd cursor updatable?
>>Thanks.
>>
>>
>>
>>
>>>Inge,
>>>
>>>You will have to select the data into two different cursors. You can then select into a third cursor joining the data form both or you can index one of them and use "set relation". Either way, you will have to join the data together from the cursors created with the sqlexec().
>>>
>>>
>>>
>>>>I'm using SPT (ODBC).
>>>>I have 2 different handles since I have 2 different database in 2 different paths/locations (2 different connection strings).
>>>>
>>>>I have a grid with text box.
>>>>Currently the text box shows employee ID.
>>>>I want to show Employee name instead.
>>>>The employee ID came from the 1st database,
>>>>but the names are stored in the 2nd database (different location, different handle).
>>>>
>>>>Here's what I currently have for my SQLEXEC:
>>>>lSuccess=SQLEXEC(THIS.lnHandle1,"SELECT empid FROM mytable1 WHERE refno='&zRefno' ","cCursor1")
>>>>
>>>>The grid has .RecordSourcetype=1
>>>>.RecordSource='cCursor1'
>>>>
>>>>How do I code my SQLEXEC so that cCursor1 reflects Employee name (from a different handle, THIS.lHandle2)? Can that be done?
>>>>What I want is the grid to show employee name instead of the ID.
>>>>
>>>>(cCursor1 is set up so that it is updatable -- used CURSORSETPROP).
>>>>
>>>>Thank you all.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform