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. 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);
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);
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);
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);
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);
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); >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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 ?
...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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,...
|
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...
|
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...
| |