Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC connection to Oracle
Message
From
04/10/2002 13:41:35
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00707782
Message ID:
00707844
Views:
18
This will give you a cursor...

lnHandle = sqlconnect("ggserv","ggldev","gglpass")

? sqlexec(lnHandle, "select...", "curTemp")


In order to obtain a VIEW...

1. Create a connection in the DBC.
2. Create a view connected to the connection as shared
3. Open the view
4. Apply CursorSetProp() settings to the view.



Have fun...


IF !llExit
* Create either a local or remote view
IF EMPTY(goApp.cRemoteConnection) OR THIS.lForceLocal
*THIS.OpenTables() && required if the physical name does not match the table name
CREATE SQL VIEW (lcView) AS &lcSql
ELSE
CREATE SQL VIEW (lcView) CONNECTION (goApp.cRemoteConnection) SHARE AS &lcSql
ENDIF
ENDIF

* If we are to use this view, open it and set its properties
IF THIS.lUseView
IF !EMPTY(THIS.nDataSessionID)
lnOldDataSessionID = SET("DATASESSION")
SET DATASESSION TO THIS.nDataSessionID
ENDIF
IF USED(THIS.cCursor)
USE IN THIS.cCursor
ENDIF

SELE 0
lcCurrentTalk = SET("TALK")
IF !EMPTY(THIS.cSetTalk)
lcNewTalk = THIS.cSetTalk
SET TALK &lcNewTalk
ENDIF
USE (lcView) ALIAS (THIS.cCursor)
SET TALK &lcCurrentTalk

llResult = CURSORSETPROP("SendUpdates", THIS.lSendUpdates) AND ;
CURSORSETPROP("Buffering", THIS.nBuffering) AND ;
CURSORSETPROP("CompareMemo", THIS.lCompareMemo) AND ;
CURSORSETPROP("BatchUpdateCount", THIS.nBatchCount)

* only perform the following if updating the table
GO BOTTOM
GO TOP
IF llResult AND THIS.lSendUpdates
* Go bottom to ensure we have all records, then place pointer back at the top
IF EMPTY(THIS.cUpdatableFieldList)
THIS.cStoreUpdatableFieldList = THIS.GetUpdatable()
ELSE
THIS.cStoreUpdatableFieldList = THIS.cUpdatableFieldList
ENDIF
llResult = CURSORSETPROP("UpdatableFieldList", THIS.cStoreUpdatableFieldList)

IF llResult
THIS.cKeyFieldList = THIS.getKeyFieldList()
ENDIF
IF llResult AND !EMPTY(THIS.cKeyFieldList)
llResult = CURSORSETPROP("KeyFieldList", THIS.cKeyFieldList)
ENDIF
IF llResult AND !EMPTY(THIS.cTables)
llResult = CURSORSETPROP("Tables", THIS.cTables)
ENDIF
IF llResult AND !EMPTY(THIS.cUpdateNameList)
llResult = CURSORSETPROP("UpdateNameList", THIS.cUpdateNameList)
ENDIF
ENDIF

* Set the data session back
IF !EMPTY(THIS.nDataSessionID)
SET DATASESSION TO (lnOldDataSessionID)
ENDIF
ENDIF

* Set the database back
SET DATABASE TO &lcOldDBC
Gordon de Rouyan
DC&G Consulting
Edmonton, Alberta
Email: derouyag@shaw.ca
Previous
Reply
Map
View

Click here to load this message in the networking platform