[plt-scheme] Advise debugging my srpersist connection (w/ postgres)

From: Richard Michael (rmichael at fields.utoronto.ca)
Date: Tue Sep 10 00:04:22 EDT 2002

Hi folks,

I'd be open to and appreciate any comments on a problem I've having.
I'm trying to request a statement handle to my DB:

(lib-"srpersist.ss" "srpersist"))
(define r-env-h (alloc-handle 'sql-handle-env))
(define r-con-h (alloc-handle 'sql-handle-dbc r-env-h))
(define r-stmt-h (alloc-handle 'sql-handle-stmt r-con-h))

The last call to "alloc-handle" returns:

"Unspecified error in alloc-handle".

I then tried:

(drivers r-env-h 'sql-fetch-first)

-AND-

(drivers r-env-h 'sql-fetch-next)

instead of the final define to get the statement handle.  Both of the
calls to the "drivers" method return:

"SQL_NO_DATA error in drivers"

This is precisely the same error that was returned when I was debugging
iODBC with their provided "odbtest" program.  To resolve it, I had to
specify a very particular ODBC connect statement: 

"dsn=PostgreSQL;server=localhost;post=5432;database=life;uid=postgres"

When I was debugging iODBC, I was able read the contents of a
tracefile.. in this case though, iODBC isn't writing anything to the
tracefile, so perhaps srpersist isn't getting as far along in the
connection initilization. 

Can someone offer some debugging tips?  Can I explicitly specify a
connect string somewhere?  Is there some verbose error checking offered
by DrScheme so I can determine the "Unspecified error" I'm getting?

Much thanks,
Richard



Posted on the users mailing list.