Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQLConfigDataSource problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00111019
Message ID:
00111187
Vues:
20
>>>Any ideas on why the following is failing (returns 0)?
>>>DECLARE Integer SQLConfigDataSource in odbccp32 ;
>>>   Integer, Integer, String, String
>>>lcODBCDriver="MSORCL32"
>>>lcSettings="DSN=Locator"+chr(0)+;
>>>           "Description=Region 6 Locator"+chr(0)+;
>>>           "Server=Reg6"+chr(0)+;
>>>           "UID=Reader"
>>>lnSuccess=SQLConfigDataSource(0, 1, lcODBCDriver, lcSettings)
>>>return lnSuccess
>>>
>>>This is trying to setup a new DSN with the 32-bit MS ODBC drivers for Oracle
>>>
>>>TIA
>>Mark,
>>
>>In the function declaration, does it return a BOOL or a DWORD. If it's a BOOL then 0 does indeed mean that the function failed. However, many functions return 0 (ERROR_SUCCESS) if they're not returning handles, etc.
>
>My guess is it is returning Bool -- I go into Win 95 registry and/or ODBC Mgr and the entry does not appear, therefore it has failed to be created.
>
>I have done this in the past, and it worked. I am stumped as to where to go from here. I can *manually* add the new DSN via the 32-bit ODBC Manager. But I want to be able to programmatically create the DSN if it does not exist on a user's computer. I have been able to check successfully for the existence (or not) of a DSN.

Sorry, Mark, I think you left the ending PRE tag off, and I can't reply directly to that message.

Anyway, from what I saw, I'd try declaring and passing the strings by reference rather than value (the "lp" prefix on the declaration indicates it). Further, you also should probably pass the calling window's handle. This might be necessary for messaging.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform