Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC API - SQLPrimaryKeys() not working
Message
From
18/12/1999 18:31:17
 
 
To
18/12/1999 14:37:59
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00305684
Message ID:
00305726
Views:
18
Hi!

Tried it out but it still returns 65534

ls_PKey = GetPKeys("northwnd","dbo","Products")
*-- ls_PKey is always 65534

Sarosh

Func GetPKeys(as_TableQualifier, as_TableOwner, as_TableName)
local ls_Return, oHeap, nCatNamePtr, nSchNamePtr, nTabNamePtr, m.olddec

m.olddec = set("decimal")
set deci to 0
hstmt = val(SYS(3053)) && SYS(3053) - ODBC Environment Handle
set deci to (m.olddec)

DECLARE INTEGER SQLPrimaryKeys IN ODBC32 ;
INTEGER hStmt, ;
INTEGER nCatalogNamePtr, ;
SHORT nCatalogNameLength, ;
INTEGER nSchemaNamePtr, ;
SHORT nSchemaNameLength, ;
INTEGER nTableNamePtr, ;
SHORT nTableNameLength

SET PROC TO CLSHEAP ADDITIVE
oHeap = CREATEOBJ('Heap')
nCatNamePtr = oHeap.AllocString(as_TableQualifier)
nSchNamePtr = oHeap.AllocString(as_TableOwner)
nTabNamePtr = oHeap.AllocString(as_TableName)

ls_Return = SQLPrimaryKeys(hstmt, ;
@ nCatNamePtr, ;
LEN(as_TableQualifier) + 1, ;
@ nSchNamePtr, ;
LEN(as_TableOwner)+ 1, ;
@ nTabNamePtr, ;
LEN(as_TableName) + 1 )

oHeap = null
RELEASE PROC CLSHEAP

Return ls_Return
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform