[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Any Examples of COM (and perhaps ADO)?



> Is that "103-p3" or something else?

My version of DrScheme and MzScheme are plain old "103", according to the
About box and the "(version)" function.  I downloaded MysterX 103-p3 much
more recently.  Should I upgrade DrScheme?

> Have you tried the same experiement in plain MzScheme?

I just did.  You'll be pleased to know I haven't been able to duplicate the
error under MzScheme.  The problem seems to only happen on the second and
subsequent presses of the Execute button in DrScheme.  Since MzScheme
doesn't have an equivalent to the Execute button (does it?), I can't
duplicate the error.  Repeatedly loading the same file using (load
"adotest.scm") in MzScheme did not cause a problem.

However, I can do the same thing in DrScheme - load the same file multiple
times, either in the definitions or interactions window - and it works fine.
The problem doesn't occur until an ADO Connection object has been
instantiated and opened one or more times, whether in the definitions or
interactions window.  After that's happened, any subsequent presses of
Execute will fail.

> You might instead try putting the program in the definitions
> window, and hitting the Execute button.

That's what I've been doing all along, except for the last test above which
I tried in both windows.  The strange thing is I would expect that pressing
Execute would clear all traces of the previous execution, but when an opened
ADO Connection object is involved, that's not happening.  Hence my attempt
to use (exit) earlier.

I also tried the following code, while attempting to duplicate the error
under MzScheme.  Again, MzScheme works, and DrScheme fails on the second
execution:

	(require-library "mysterx.ss" "mysterx")

	(define (test-ado)
		(let [(conn (cci/progid "ADODB.Connection"))]
			(com-invoke conn "Open" "DSN=epas;UID=sa;PWD=###")
			(com-invoke conn "Close")))
	(test-ado)

Under DrScheme, I can use Execute with the above in the definitions window,
and then call test-ado multiple times in the interaction window without a
problem.  As soon as I press Execute for the second time, I get the error
when (test-ado) executes.

> I've used MysterX mostly with Excel, and haven't experienced the kinds
> of problems you and Alex have found.

One difference is that the ADO objects are using external resources, like
database connections through an ODBC or OLE DB driver.  Most Excel objects
would not be doing anything comparable, and would only be using resources
internal to the Excel COM servers.  How that relates to the behavior I'm
seeing, I have no idea...

Anton