Solved

Passing cursor to VB Com object

Posted on 2000-03-19
7
269 Views
Last Modified: 2013-11-25
How do I pass a cursor/entire record to a com object.

I create that object using sp_oaCreate


thank you
0
Comment
Question by:fkmfkm
  • 4
  • 3
7 Comments
 
LVL 7

Accepted Solution

by:
tchalkov earned 200 total points
ID: 2635463
You can't fo it directly.
Because sp_oaCreate uses some sort of hadles, you can't pass a COM object as a parameter. So you can't pass Recordset for exmaple.

A possible solution to pass a single record is to conacatenate all teh fields in the record, and separate them with some separation character. Then pass the resulting string as a parameter to the control.

As for complete recordset - either pass the query string to the com object, or copy the recordset in a table, and pass the table name to the object.
0
 

Author Comment

by:fkmfkm
ID: 2635513
I have pasted this from the SQL Books online. But I do not understand it.

1. Client ? what does it mean by client ?

2. Array ? if in TSQL how to declare an array ?

I hope u can help.


Result Sets
If the property returns an array with one or two dimensions, the array is returned to the client as a result set:

A one-dimensional array is returned to the client as a single-row result set with as many columns as there are elements in the array. In other words, the array is returned as (columns).
A two-dimensional array is returned to the client as a result set with as many columns as there are elements in the first dimension of the array and with as many rows as there are elements in the second dimension of the array. In other words, the array is returned as (columns, rows).
0
 
LVL 7

Expert Comment

by:tchalkov
ID: 2635549
The above text is about OLE Object returning arrays to the SQL Server. Not the opposite, which you are asking for.

0
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 

Author Comment

by:fkmfkm
ID: 2662520
Sorry for taking so long to reply...


Is there any better way to do this ? I hope u can help
0
 
LVL 7

Expert Comment

by:tchalkov
ID: 2663247
I don't know any other way to do this except what I've suggested you in my answer.

However there is still something you can do - if TSQL is not enough for you then you can try to write an external stored procedure which is a DLL - VC ++ 6.0 has a wizard which helps you do that. Then you can do whatever you want in that DLL.
0
 

Author Comment

by:fkmfkm
ID: 2663714
Can it be an Active X dll written in VB

cause I dunno VC++

:) By the way thank you
0
 
LVL 7

Expert Comment

by:tchalkov
ID: 2663828
I don't know if an extended stored procedure can be written in VB. It is not an ActiveX control.

Generally the idea is that if TSQL is not enough then use something else - for example you can write an ActiveX, which calls teh SQL Server and is doing some work on the data, and call this ActiveX instead of directly calling the SQL Server.

Or you can put some of the work into an ActiveX, which you call from SQL Server using sp_oacreate
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now