Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SQOLEDB adoCmd.Properties("Output Stream") Error

55 views
Skip to first unread message

Scott Cropley

unread,
Jun 25, 2003, 7:09:46 PM6/25/03
to
I've seen many a post, but no solution to this problem.


Set oCN = New ADODB.Connection
s = "Provider=SQLOLEDB.1"
s = s & ";Data Source=" & goConnections(App.Title).Server
s = s & ";Initial Catalog=" & goConnections(App.Title).Database
s = s & ";Trusted_Connection=true"
s = s & ";"
oCN.Open s, "sa", "sa"

Set adoStreamQuery = New ADODB.Stream
adoStreamQuery.Open
adoStreamQuery.WriteText sSql, adWriteChar
adoStreamQuery.Position = 0

Set adoCmd = New ADODB.Command
Set adoCmd.CommandStream = adoStreamQuery
adoCmd.Dialect = "{5d531cb2-e6ed-11d2-b252-00c04f681b71}"

Set strm = New ADODB.Stream
strm.Open
adoCmd.Properties("Output Stream").Value = ts
Set adoCmd.ActiveConnection = goConnections(App.Title)
adoCmd.Execute , , 1024

When Setting the adoCmd.Properties("Output Stream").Value I get....

"Item cannot be found in the collection corresponding to the requested
name or ordinal."

I've installed MDAC 2.7 and Sql 2k sp3....

Does anyone have any Ideas!

Drew Seale

unread,
Jun 26, 2003, 10:06:52 AM6/26/03
to
Even though the default property of a Property object is "Value". The
Output stream does not support that when specified directly.

Try:
adoCmd.Properties("Output Stream") = ts

"Scott Cropley" <sc...@andrew-scott.com> wrote in message
news:OwiNU72O...@TK2MSFTNGP10.phx.gbl...

Scott Cropley

unread,
Jun 26, 2003, 10:40:34 AM6/26/03
to
Actually, I foun the problem last night. The problem was two fold...

First I was not setting the active connection of the command object until
after the suspect "Output Stream" property, Plus, I was not setting the
Active connction to the SQLOLEDB connection I had built. By not having this
done the Command object could see the property lists exposed by the
connection dialect. OOPS!

Thanks.

s.

"Drew Seale" <dr...@xformity.com> wrote in message
news:OONoyw%23ODH...@TK2MSFTNGP10.phx.gbl...

0 new messages