Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Returning GUID to VB
Message
De
26/04/2004 17:43:26
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Returning GUID to VB
Divers
Thread ID:
00898329
Message ID:
00898329
Vues:
40
Hi,

I need a little advice. I have a Fox database that has several different fox apps and one VB app hitting it. In the database is a patient table that has a column "PK"

PK defaults to a GUID via a stored procedure within the dbc. The procedure works fine, from within Fox.

However, when I use ADO to attach to the database from within VB and get a new record, the function fails because it doesn't recognize the OLE32.dll and sets pk to NULL.

Here is the call:
*-- From the default value setting for the PK field in the dbc
getGUID()
Here is the code in question:
*-- This is the function in the stored procedure
function GetGUID
  * Gets a 16-byte GUID
  declare integer CoCreateGuid ;
    in Ole32.dll ;
    string @lcGUIDStruc
  * Simulate GUID strcuture with a string:
  local lcStruc_GUID
  lcStruc_GUID = space(16)
  if CoCreateGuid(@lcStruc_GUID) # 0
    return ""
  endif
  return m.lcStruc_GUID
endfunc  && GetGUID
So what can I do to make the OLE32.DLL work correctly when I am accessing the stored procedure via an ADO in VB.

Things tried to date include:
- Setting a full path to the OLE32.dll file
- Putting a copy of the OLE32.dll in the same directory as the dbc
- Putting the OLE32.dll in the same directory as the vb project
Carole Shaw
Fred Hutchinson Cancer Research Center

Eagles may soar, but weasels don't get sucked into jet engines.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform