Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement