Re: ADO:VB6 Object not opened error. Guidance please?
- From: "Geoff" <NoSpam@xxxxxx>
- Date: Thu, 10 Aug 2006 22:30:10 -0700
<adalton@xxxxxxxxxxx> wrote in message news:ebg0et01hev@xxxxxxxxxxxxxxxxxxxx
Hello everyone! -Comp.Lang.basic.viusal.database group.
First off - I originally posted this in the
I think I may have posted in the wrong group so I copied it here.. If I amwrong, let
me know and I pologize in advance... Now.. Here goes -only have
I am exremely new to ADO (Ver 2.8). I'm a DAO 3.6 from old school and I
I have 1 ADO book as a reference. I am not using an SQL server, or MySQL.field, within
This is a subroutine of a larger program which is supposed to search a
a table, inside a database. (which I can't code until I can successfullyaccess the
database in the first place)as an
Using VB6 Enterprise, I am trying to open a Access database that I set up
ODBC SQL as a System DSN called "MasterItemsDNS" in the system tab.a
Now, it finds the MasterItemsDNS fine , but when the code executes, I get
'Operation not allowed when object is closed" error.Database,
(Highlighted code that has the error is preceded by an arrow)
I realize I missed something here, but can not find it. I opened the
created the new recordset, and I think it was opened. But the proggiesays 'NO'
You have set a new recordset, you then need to open it with the data you
require using the connection you have made.
eg
Dim con As ADODB.Connection
Dim rst As ADODB.Recordset
Set con = New ADODB.Connection
Set rst = New ADODB.Recordset
'
con.Open "MasterItemsDNS"
rst.Open "SQL STRING", con, adOpenStatic 'select cursor type
'
If rst.Supports(adBookmark) Or rst.Supports(adApproxPosition) Then
NumRecords = rst.RecordCount
Else
'cursor type does not support record count
End If
'===========================================================================
=====
'DO STUFF
'===========================================================================
=====
'close rst & conn
rst.Close: Set rst = Nothing
con.Close: Set con = Nothing
.
- Follow-Ups:
- References:
- ADO:VB6 Object not opened error. Guidance please?
- From: adalton
- ADO:VB6 Object not opened error. Guidance please?
- Prev by Date: Re: Question on IE7 Beta 3 - not VB6
- Next by Date: Re: Question on IE7 Beta 3 - not VB6
- Previous by thread: ADO:VB6 Object not opened error. Guidance please?
- Next by thread: Re: ADO:VB6 Object not opened error. Guidance please?
- Index(es):
Relevant Pages
|