473,406 Members | 2,217 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,406 software developers and data experts.

Open Unconnected ADORecordset

I am trying to open an Unconnected/Disconnected ADORecordset.

Using VB I would use the following function call

rs.Open()

However C# requires a Source and Connection.
What do I pass in?
I have tried null, the null string, zeros, empty objects but I keep getting
a runtime error when I try to open the Recordset

Any help would be appreciated.
Mar 2 '06 #1
6 1767
Brent Rogers wrote:
I am trying to open an Unconnected/Disconnected ADORecordset.

Using VB I would use the following function call

rs.Open()

However C# requires a Source and Connection.
What do I pass in?
I have tried null, the null string, zeros, empty objects but I keep getting
a runtime error when I try to open the Recordset

Any help would be appreciated.


add the Interop goo to the using statement. Then

rs.Open(Type.Missing, Type.Missing);
Mar 2 '06 #2
Frank:

When I try that I get the error:

The connection cannot be used to perform this operation. It is either closed
or invalid in this context.

"Frank Rizzo" wrote:
Brent Rogers wrote:
I am trying to open an Unconnected/Disconnected ADORecordset.

Using VB I would use the following function call

rs.Open()

However C# requires a Source and Connection.
What do I pass in?
I have tried null, the null string, zeros, empty objects but I keep getting
a runtime error when I try to open the Recordset

Any help would be appreciated.


add the Interop goo to the using statement. Then

rs.Open(Type.Missing, Type.Missing);

Mar 2 '06 #3
Brent Rogers wrote:
Frank:

When I try that I get the error:

The connection cannot be used to perform this operation. It is either closed
or invalid in this context.
Then the connection is probably not assigned to the recordset.

rs.ActiveConnection = whatever your connection is.

"Frank Rizzo" wrote:
Brent Rogers wrote:
I am trying to open an Unconnected/Disconnected ADORecordset.

Using VB I would use the following function call

rs.Open()

However C# requires a Source and Connection.
What do I pass in?
I have tried null, the null string, zeros, empty objects but I keep getting
a runtime error when I try to open the Recordset

Any help would be appreciated.

add the Interop goo to the using statement. Then

rs.Open(Type.Missing, Type.Missing);

Mar 3 '06 #4
The thing is that I dont have a connection..

"Frank Rizzo" wrote:
Brent Rogers wrote:
Frank:

When I try that I get the error:

The connection cannot be used to perform this operation. It is either closed
or invalid in this context.


Then the connection is probably not assigned to the recordset.

rs.ActiveConnection = whatever your connection is.

"Frank Rizzo" wrote:
Brent Rogers wrote:
I am trying to open an Unconnected/Disconnected ADORecordset.

Using VB I would use the following function call

rs.Open()

However C# requires a Source and Connection.
What do I pass in?
I have tried null, the null string, zeros, empty objects but I keep getting
a runtime error when I try to open the Recordset

Any help would be appreciated.
add the Interop goo to the using statement. Then

rs.Open(Type.Missing, Type.Missing);

Mar 3 '06 #5
Brent Rogers wrote:
The thing is that I dont have a connection..
You mean, previously you saved the recordset to a file and now you're
trying to reopen it?

In that case, you have to pass in the name of that file.

You are not sharing a lot of information. Kind of difficult to help.

"Frank Rizzo" wrote:
Brent Rogers wrote:
Frank:

When I try that I get the error:

The connection cannot be used to perform this operation. It is either closed
or invalid in this context.

Then the connection is probably not assigned to the recordset.

rs.ActiveConnection = whatever your connection is.
"Frank Rizzo" wrote:

Brent Rogers wrote:
> I am trying to open an Unconnected/Disconnected ADORecordset.
>
> Using VB I would use the following function call
>
> rs.Open()
>
> However C# requires a Source and Connection.
> What do I pass in?
> I have tried null, the null string, zeros, empty objects but I keep getting
> a runtime error when I try to open the Recordset
>
> Any help would be appreciated.
add the Interop goo to the using statement. Then

rs.Open(Type.Missing, Type.Missing);

Mar 6 '06 #6
What I wanted was actually an 'In Memory' recordset.
I wanted to be able to perform the same action as the VB:
rs.Open()
would do.

I was able to do this with the following:
MyRecordset.Open( Missing.Value
,Missing.Value ,ADODB.CursorTypeEnum.adOpenUnspecified ,ADODB.LockTypeEnum.adLockUnspecified ,(int)ADODB.CommandTypeEnum.adCmdUnspecified );

The key was setting the Options parameter to:
(int)ADODB.CommandTypeEnum.adCmdUnspecified
rather than null and/or zero.

"Frank Rizzo" wrote:
Brent Rogers wrote:
The thing is that I dont have a connection..


You mean, previously you saved the recordset to a file and now you're
trying to reopen it?

In that case, you have to pass in the name of that file.

You are not sharing a lot of information. Kind of difficult to help.

"Frank Rizzo" wrote:
Brent Rogers wrote:
Frank:

When I try that I get the error:

The connection cannot be used to perform this operation. It is either closed
or invalid in this context.
Then the connection is probably not assigned to the recordset.

rs.ActiveConnection = whatever your connection is.

"Frank Rizzo" wrote:

> Brent Rogers wrote:
>> I am trying to open an Unconnected/Disconnected ADORecordset.
>>
>> Using VB I would use the following function call
>>
>> rs.Open()
>>
>> However C# requires a Source and Connection.
>> What do I pass in?
>> I have tried null, the null string, zeros, empty objects but I keep getting
>> a runtime error when I try to open the Recordset
>>
>> Any help would be appreciated.
> add the Interop goo to the using statement. Then
>
> rs.Open(Type.Missing, Type.Missing);
>

Mar 7 '06 #7

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

Similar topics

1
by: user mysql | last post by:
HELLO FRIENDS. HERE A FANTASTIC NEWS FOR MYSQL WINDOWS USER. READE THIS. The article is grab from www/internetnews/com/ DO YOU THINK THAT IS A GOOD NEWS ? ...
18
by: Paul | last post by:
I link to a web site from an Excel spreadsheet. The page i link to is getCookie.asp which sets a cookie then returns back some html which opens a new window, to the same site but a different page...
3
by: NeverLift | last post by:
But, if it's not open, I don't want to open it . . . using window.open will open it if it doesn't exist, even if the url in that open is null (the window is then empty -- but it's open). The...
1
by: C Sharp beginner | last post by:
I'm sorry about this verbose posting. This is a follow-up to my yesterday's posting. Thanks William for your reply. I understand it is a good practice to open connections as late as possible and...
6
by: Brad | last post by:
I have a win2003 server workstation with multiple webs, each web has it's own ip address. In VS2005, if I select to open an existing web site, select Local IIS, the dialog correctly displays a...
7
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses...
19
by: =?Utf-8?B?R3JlZw==?= | last post by:
How can I tell via code if a Form is already open. Each time my forms load I have some initialization code that runs, but if the form is already open and hidden I don't want that initialization...
0
by: Salad | last post by:
A97. Split database. Frontend DB1.MDB. Backend DB1BE.MDB. Tables are linked between DB1 and DB2. From my testing, if I open DB1 exclusively using /excl the backend DB1BE is not opened...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.