Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
Newbie problem with Data Environment (binding recordest)
Old
  (#1)
Matik
Guest
 
Posts: n/a
Default Newbie problem with Data Environment (binding recordest) - 06-04-2007, 09:48 AM

Hello everybody,

I have (I think) very simple question. How do I can bind the data from
DE to the VB application (VB 6).
I have:
- propery connected Access Database in DE,
- very simple table mapped as a Commad,
- try to fetch the data from the cursor
- piece of my code looks like:

DataEnv.rsStackers.Open
i = DataEnv.rsStackers.RecordCount
DataEnv.rsStackers.MoveFirst
DataEnv.rsStackers.MoveLast
i = DataEnv.rsStackers.RecordCount

In this table I do have three records, but I become the RecordCount =
0, and on the MoveFirst EOF, BOF error.

I will be very glad, for getting an example from You, in which easy
way can I do this.
Before, I was doing that by 'old' good methods:
Create workspace, database object, dynamicly opening the records from
file. But I read, this way seams to be easy, and can save lot of time
;-)
Now I'm very curious, why it do not work!

Thank's

Mateusz
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Newbie problem with Data Environment (binding recordest)
Old
  (#2)
Allcomp
Guest
 
Posts: n/a
Default Re: Newbie problem with Data Environment (binding recordest) - 06-04-2007, 09:48 AM

Hello,

To use the dataenvironment (DE) to use the recordser rsStackers, you must do
that

DE.Stackers (The recordset is created only when you use the method Stackers)
After that, you can work with the recordset
With db.rsStackers
for i = 1 to .Recordcount

.MoveNext
Next i
.Close
End with
Depending on your options for the connection, you will need (or not) to make
a
..movelast and .MoveFirst

Marc Allard
Allcomp

"Matik" <EMAIL REMOVED> a écrit dans le message de news:
EMAIL REMOVED...
> Hello everybody,
>
> I have (I think) very simple question. How do I can bind the data from
> DE to the VB application (VB 6).
> I have:
> - propery connected Access Database in DE,
> - very simple table mapped as a Commad,
> - try to fetch the data from the cursor
> - piece of my code looks like:
>
> DataEnv.rsStackers.Open
> i = DataEnv.rsStackers.RecordCount
> DataEnv.rsStackers.MoveFirst
> DataEnv.rsStackers.MoveLast
> i = DataEnv.rsStackers.RecordCount
>
> In this table I do have three records, but I become the RecordCount =
> 0, and on the MoveFirst EOF, BOF error.
>
> I will be very glad, for getting an example from You, in which easy
> way can I do this.
> Before, I was doing that by 'old' good methods:
> Create workspace, database object, dynamicly opening the records from
> file. But I read, this way seams to be easy, and can save lot of time
> ;-)
> Now I'm very curious, why it do not work!
>
> Thank's
>
> Mateusz



   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Newbie problem with Data Environment (binding recordest)
Old
  (#3)
Matik
Guest
 
Posts: n/a
Default Re: Newbie problem with Data Environment (binding recordest) - 06-04-2007, 09:48 AM

Hello once again!

I think I'm doing something wrong. I do like You said,

DataEnv.Stackers
z = DataEnv.rsStackers.RecordCount

And I get the error:
3705 - Operation is not allowed, when the object is open.

I'm trying to find what I did wrong, but if You have any idee, I will
be very appreciate for any help.

Mateusz

> To use the dataenvironment (DE) to use the recordser rsStackers, you must do
> that
>
> DE.Stackers (The recordset is created only when you use the method Stackers)
> After that, you can work with the recordset
> With db.rsStackers
> for i = 1 to .Recordcount
>
> .MoveNext
> Next i
> .Close
> End with
> Depending on your options for the connection, you will need (or not) to make
> a
> .movelast and .MoveFirst

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Newbie problem with Data Environment (binding recordest)
Old
  (#4)
Allcomp
Guest
 
Posts: n/a
Default Re: Newbie problem with Data Environment (binding recordest) - 06-04-2007, 09:49 AM

Hello,

When do you have the error :

If it is in the line DataEnv.Stackers, it means that the recordset is
already open and you have not made the .Close
To see if it is that, you try a DataEnv.rsStackers.Close (in the immediate
window) and you can see if it is correct after that. If you make a gosub,
goto... you have to close the recordset (or avoid gosub and goto)

Marc Allard
Allcomp




"Matik" <EMAIL REMOVED> a écrit dans le message de news:
EMAIL REMOVED...
> Hello once again!
>
> I think I'm doing something wrong. I do like You said,
>
> DataEnv.Stackers
> z = DataEnv.rsStackers.RecordCount
>
> And I get the error:
> 3705 - Operation is not allowed, when the object is open.
>
> I'm trying to find what I did wrong, but if You have any idee, I will
> be very appreciate for any help.
>
> Mateusz
>
>> To use the dataenvironment (DE) to use the recordser rsStackers, you must
>> do
>> that
>>
>> DE.Stackers (The recordset is created only when you use the method
>> Stackers)
>> After that, you can work with the recordset
>> With db.rsStackers
>> for i = 1 to .Recordcount
>>
>> .MoveNext
>> Next i
>> .Close
>> End with
>> Depending on your options for the connection, you will need (or not) to
>> make
>> a
>> .movelast and .MoveFirst



   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Newbie problem with Data Environment (binding recordest)
Old
  (#5)
Matik
Guest
 
Posts: n/a
Default Re: Newbie problem with Data Environment (binding recordest) - 06-04-2007, 09:49 AM

hej,


> If it is in the line DataEnv.Stackers, it means that the recordset is
> already open and you have not made the .Close
> To see if it is that, you try a DataEnv.rsStackers.Close (in the immediate
> window) and you can see if it is correct after that. If you make a gosub,
> goto... you have to close the recordset (or avoid gosub and goto)


The problem is already solve. Thank you for help!

Mateusz
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top