Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ODBC API - SQLPrimaryKeys() not working
Message
De
18/12/1999 18:31:17
 
 
À
18/12/1999 14:37:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00305684
Message ID:
00305726
Vues:
17
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform