TODBC

TODBC

Postby ryugarai27 » Sun Mar 21, 2010 4:48 am

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?
User avatar
ryugarai27
 
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines

Re: TODBC

Postby lailton.webmaster » Sun Mar 21, 2010 5:10 pm

you have installed the MySQL ODBC?
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: TODBC - solved

Postby ryugarai27 » Thu Mar 25, 2010 2:22 am

Lailton,

No. I've already installed ADS ODBC driver. I remember I didn't supply a username during ODBC driver installation, thus :

Local oODBC := TOdbc():New("AdvData")

solved the problem.

Thanks anyway..
User avatar
ryugarai27
 
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines

Re: TODBC - solved

Postby fraxzi » Thu Mar 25, 2010 3:47 am

ryugarai27 wrote:Lailton,

No. I've already installed ADS ODBC driver. I remember I didn't supply a username during ODBC driver installation, thus :

Local oODBC := TOdbc():New("AdvData")

solved the problem.

Thanks anyway..



Hey bro...
Kamusta ka na?

Best regards,
from us.
Kind Regards,
Frances

Fivewin for xHarbour v18.07
xHarbour v1.2.3.x
BCC 7.3 + PellesC8 ( Resource Compiler only)
ADS 10.1 / MariaDB
Crystal Reports 8.5/9.23 DE
xMate v1.15
User avatar
fraxzi
 
Posts: 811
Joined: Tue May 06, 2008 4:28 am
Location: Philippines


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 93 guests