FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour GPF when using todbc
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
GPF when using todbc
Posted: Mon Dec 08, 2008 10:37 AM
Hi,

When trying to open a Sage file using todbc i'm getting a GPF when calling :-)pen() command. Here is a cut-down version of the code that i'm using:

oOdbc := TOdbc():New(cDsn, cName, cPass)

	If !oOdbc:lSuccess
		oOdbc:ShowErrorList("ODBC session not successfully initialized, aborting...")
		oOdbc:End()
		retu nil
	Endif
	
	oDbf := oOdbc:Query( "SELECT * FROM " + cTable )
	oDbf:lDateAsStr := .t.
	oDbf:Open()
	oDbf:Complete()


Any ideas why i'm getting the gpf?

Thanks in advance

Pete
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
GPF when using todbc
Posted: Mon Dec 08, 2008 01:13 PM

Pete,

I have never used these classes, but I note that the oDBF:open() method is trying to create a DBF. This might fail if the user doesn't have the proper rights.

If that isn't the problem, then I suggest compiling the TDBODBC.PRG and linking it into your program. This way you can put msgInfo()'s into the Open method until you find the exact line that is causing the GPF.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
GPF when using todbc
Posted: Mon Dec 08, 2008 02:19 PM

I think the problem is due to the number of fields in the table that i'm opening (141 fields) - if i just select the first field, my routine works. So is there a limit to the size of fields in a table?

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
GPF when using todbc
Posted: Mon Dec 08, 2008 02:28 PM

Peter,

141 fields shouldn't be a problem. Perhaps there is an unsupported datatype field?

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
GPF when using todbc
Posted: Mon Dec 08, 2008 02:31 PM

Thats possible i suppose - the trouble is that its hard to find the field types from sage.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
GPF when using todbc
Posted: Mon Dec 08, 2008 08:53 PM

Peter,

Better use ADO. There are many ADO examples in these forums.

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion