Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create a User DSN in ODBC Data Source Administrator
Message
De
13/11/1999 07:34:09
 
 
À
13/11/1999 06:12:14
Joao Godinho
Fredesenvolv, Lda
Lisbon, Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00290887
Message ID:
00290896
Vues:
28
Dear Jaoa ,

Just study the code written below

*** Code Starts here
PARAMETER lODBCType && Pass the paratamter as .T.
#DEFINE ERROR_SUCCESS 0
#DEFINE C_EXTNOFOUND_LOC "No information available for selected application."


LOCAL oReg,regfile,nErrNum,lDrivers
PUBLIC aODBCData
lDrivers = .F.

IF PARAMETERS()=1 AND TYPE("m.lODBCType")="L" AND m.lODBCType
m.lDrivers = .T.
ENDIF

regfile = "registry.prg" && this you will get in the VFP DIRECTORY OR ELSE MAIL ME.
IF !FILE(m.regfile)
MESSAGEBOX("No file exists please check",0+64,"Miracle")
RETURN
ENDIF

SET PROCEDURE TO "registry.prg" ADDITIVE
oReg = CreateObject("odbcreg")

DIMENSION aODBCData[1]
IF m.lDrivers
m.nErrNum = oReg.GetODBCDrvrs(@aODBCData)
ELSE
m.nErrNum = oReg.GetODBCDrvrs(@aODBCData,.T.)
ENDIF

x = ascan(aODBCData,"Your ODBC DSN Name here")
if x = 0
=MessageBox("Sorry, No ODBC Drivers are setup,"+CHR(13)+CHR(13)+"Concern the developer",0+16,"Your ODBC DSN Name here")
return .f.
endif

*thisform.lstODBCData.rowsource = "aODBCData"

RELEASE PROC (m.regfile)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform