Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.ActiveConnection Gives 'Invalid use of property' error

Status
Not open for further replies.

JohnBates

MIS
Joined
Feb 27, 2000
Messages
1,995
Location
US
Hi VB'ers,

I'm using RDO to execute a SQL Server 7 stored procedure.


Global Cn As rdoConnection


Dim ManQuery As New rdoQuery
Dim Cn As rdoConnection

sSQL = "{call usp_Manual_Scan ('sSpur', 'sModel', 'sSerial')}"

ManQuery.SQL = sSQL


'**** this line gives compile error 'Invalid use of property' on ActiveConnection
ManQuery.ActiveConnection = Cn

'*******************
ManQuery.Execute


I must be doing something wrong.

Thanks for any help. John
 
I would imagine that you need to open the connection to the database. I see it declared but nowhere do I see it set to any value.

I've never used RDO but in ADO you would have to declare the connection - provide the connection string and open the connection before you can use it.
 
hi stoolpigeon,

I'm getting nowhere fast, as they say.

This is what I've got...
With ManQuery
Set .ActiveConnection = cn
.SQL = sSQL
.LockType = rdConcurReadOnly
.RowsetSize = 1
.CursorType = rdUseServer
End With

cn.Connect = sConn

ManQuery.ActiveConnection.Execute

this gives "Error 40071: The rdoConnection is not connected
to a datasource" ... yet the Immediate window says "Already connected"

If anyone has an example of how they have connected to a
SQL Server db, then executed a stored procedure... I'd really appreciate it. I'm using RDO.
Thanks, John




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top