I've CC'd the dbi-users mail list. The list contains many people who
are much more knowledgeable that myself in SQL Server and ADO.
On Mon, Oct 08, 2001 at 07:27:37PM +0200, Djordje Djokic wrote:
> I know that it is not a common thing and that you have tones of
> questions like this, but since I am very frustrated with this things I
> just made decision to try. :-) It is concerning to your DBD::ADO
> module from CPAN. I am trying to use this module to connect to MS SQL
> 7 and have very big difficulty in this. I want to say that everything
> is working fine except nested queries. Not really nested query (in one
> query), I mean nested queries when you want to open more connections in
> transaction mode. Like
>
> foreach (SELECT * FROM TABLE)
> do (SELECT * FROM ...)
>
> I suppose you know what I mean. I tried to solve this problem in last
> week and it is really frustrating. I have error message like this:
>
> cannot create new connection while in manual or distributed transaction mode
Yes, I've setup a test case for this error, however, so far I've a
solution for it. It's looking like ADO wants to a second connection
open.
> This error is pretty well known to all SQL Server users with VB and
> their solution is to change cursor type in this situation. I tried to
> figure out how to do something like that using your module, but I am
> afraid that I have not any success in that. So, I want to ask you
> next things: Have you already had this problem? Did you find a
> solution for this? How to change cursor type or any other attribute
> in connect string?
These are the attributes current supported in the connect string:
(perldoc DBD::ADO)
In addition the following attributes may be set in the connect string:
Attributes
CommandTimeout
ConnectionString
ConnectionTimeout
CursorLocation
DefaultDatabase
IsolationLevel
Mode
Provider
WARNING: The application is responsible for passing the correct
information when setting any of these attributes.
To change the cursor type you'd need to set the attribute in the
"prepare" statement, instead of the connect string, I believe.
A prepare call like:
$dbh->prepare( $sql_statement, {CursorType => adOpenStatic} ) or ...
I also need to export the ADO constants ...
Seem do able, but would this solve the problem from above or am I
going to have to open a second connect to the data source?
Tom
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com