Hi Fivewin experts:
I hope somebody could figure out the error below:
Error returned:
SQLDriverConnect error from TODBC:New()
[#-1]
On Procedure: MAIN Line: 8
The code:
#include "fivewin.ch"
#include "ads.ch"
#include "xbrowse.ch"
#include "sql.ch"
Function Main()
Local oODBC := TOdbc():New("AdvData","ryugarai","")
If !oOdbc:lSuccess
oOdbc:ShowErrorList("ODBC session not successfully initialized, aborting...")
oOdbc:End()
return nil
Endif
oDbf := oOdbc:Query( "SELECT * FROM poimport" )
if oOdbc:IsError()
oOdbc:ShowErrorList()
oOdbc:aErrors := {}
oDbf:End()
return nil
endif
oDbf:Open()
// oDbf:Complete()
Browse()
oDbf:End()
RETURN nil
//------------------------------------------------------------------------------
STATIC FUNCTION BuildMenu()
LOCAL oMenu
MENU oMenu
MENUITEM 'File'
MENUITEM 'Edit'
ENDMENU
RETURN oMenu
//------------------------------------------------------------------------------
the code works fine when used as :
Local oODBC := TOdbc():New()
but i have to supply the parameters to connect automatically to the database. any suggestions?