473,404 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Using a VB6 dynaset object in dot NET

I have a VB6 program that I'm trying to convert to run under VB.NET. The
application uses an Oracle database and Oracle OO4E objects to
connect and retrieve data:

'OraSession, Oradatabase and dynLog are Objects
'strSql is a SELECT statement

OraSession = CreateObject("OracleInProcServer.XOraSession")
Oradatabase = OraSession.dbopendatabase(DBName, ConnStr, 0&)

dynLog = Oradatabase.dbcreatedynaset(strSql, 0&)
dynLog.Refresh()
dynLog.DbMoveFirst()

All of which compiles and runs in .NET ok. In VB6 the individual data
elements retrieved by the sql select are accessed via the dynaset array
elements...

strLineNo = dynLog(4) 'a text value from the table

.... but .NET issues an exception. The object does not relate to the
context of string data.

How do I get to the data? I do NOT want to rewrite the entire
application using the .NET OLEDb controls.

Thanks

Dave
Jan 21 '07 #1
1 5006
On Sun, 21 Jan 2007 11:24:54 -0500, Dave Cullen <Da*********@mymail.comwrote:

¤ I have a VB6 program that I'm trying to convert to run under VB.NET. The
¤ application uses an Oracle database and Oracle OO4E objects to
¤ connect and retrieve data:
¤
¤ 'OraSession, Oradatabase and dynLog are Objects
¤ 'strSql is a SELECT statement
¤
¤ OraSession = CreateObject("OracleInProcServer.XOraSession")
¤ Oradatabase = OraSession.dbopendatabase(DBName, ConnStr, 0&)
¤
¤ dynLog = Oradatabase.dbcreatedynaset(strSql, 0&)
¤ dynLog.Refresh()
¤ dynLog.DbMoveFirst()
¤
¤ All of which compiles and runs in .NET ok. In VB6 the individual data
¤ elements retrieved by the sql select are accessed via the dynaset array
¤ elements...
¤
¤ strLineNo = dynLog(4) 'a text value from the table
¤
¤ ... but .NET issues an exception. The object does not relate to the
¤ context of string data.
¤
¤ How do I get to the data? I do NOT want to rewrite the entire
¤ application using the .NET OLEDb controls.

I'm not familiar with the OO4O object model but do the Dynaset array elements have a default
property, such as Value? If so, you may need to explicitly specify this property (e.g.
dynLog(4).Value).
Paul
~~~~
Microsoft MVP (Visual Basic)
Jan 22 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: MLH | last post by:
I don't want user to see the open query in a datasheet view. I just want the dynaset written to c:\myfile.xls. I was thinking... DoCmd OpenQuery "qryAFAexcelExportData", A_NORMAL, A_READONLY...
1
by: Average Bear | last post by:
If anyone could help with this one, I am a bit puzzled. I understand you can create an index using two fields of a database, then use the seek method to find a record based on both fields. My...
4
by: Kathy | last post by:
What is the standard technique for handling the fields in the following scenario on a continuous form? Multiple Divisions. Each Division has multiple Buildings. Each Building has a Supervisor. ...
2
by: MLH | last post by:
I feel pretty lucky on my last SQL question. I think I'll try one more... If there is a table (tblCorrespondence) with a field in it named and I am extracting a dynaset of records having an ...
3
by: MLH | last post by:
Without building a report, can VBA simply print a query's dynaset - much in the same manner one would by opening the query manually from the database window and clicking File, Print?
1
Corster
by: Corster | last post by:
I went through a great deal of hassle to figure this out for myself, but now it is complete, I would like to share it with the world! I know afew other people have had trouble with FindFirst and...
5
by: MLH | last post by:
Gentlemen: I have a form with a couple of textbox's containing string values: tblName and fldName. The user types a table name in one and a field name in the other. In code behind the form, I...
3
by: gismar | last post by:
hi! i'm at a loss here. after creating my form, I added data to it and the next time I started access, it did not show any of the records- they are still in the table but are not shown!! I...
4
by: Roger | last post by:
on sql 2005, I've got a view with select permission granted, the view just "select * from table" using odbc in access97, I linked this view and I create a query to retrieve certain fields the...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.