Cloning problem -- please please please help

Cloning problem -- please please please help

Post by John Sween » Tue, 01 Oct 1996 04:00:00



Hi everybody:

I am trying to make a clone of a snapshot-type recordset in VB4 16-bit under
Win 3.11.  The recordset is in a datacontrol (Data2).  I want to make a clone
of it to search for the selected item in a DBList.  I need to use a clone so I
don't change the bookmark of the recordset in the list.  I used the following
code:

...
Dim Clone2 as Recordset
Clone2 = Data2.Clone
...

At run time, I get the error "Argument not optional" with "Clone2 = "
highlighted.  I tried changing Data2.Clone to Data2.Recordset.Clone and got an
error (Method or data member not found, with ".Recordset" highlighted.  I
tried adding Dim Data2 as Recordset before the clone command (which I don't
think is necessary because the recordset already exists in the datacontrol at
startup, but I tried anyway).  Still no luck.

What am I missing?

Any help would be greatly appreciated.

 
 
 

Cloning problem -- please please please help

Post by John Sween » Tue, 01 Oct 1996 04:00:00


An update to my idiotic post:

I did a classic RTFM here.  I'm sorry.  I forgot to use Set....
Ignore me.  Flame me.  I deserve it.

jjs


says...

Quote:

>Hi everybody:

>I am trying to make a clone of a snapshot-type recordset in VB4 16-bit under
>Win 3.11.  The recordset is in a datacontrol (Data2).  I want to make a clone
>of it to search for the selected item in a DBList.  I need to use a clone so
I
>don't change the bookmark of the recordset in the list.  I used the following
>code:

>...
>Dim Clone2 as Recordset
>Clone2 = Data2.Clone
>...

>snip...


 
 
 

Cloning problem -- please please please help

Post by Jeff Fiel » Tue, 01 Oct 1996 04:00:00


[snip]

Quote:>At run time, I get the error "Argument not optional" with "Clone2 = "
>highlighted.  I tried changing Data2.Clone to Data2.Recordset.Clone and got an

don't forget a recordset is an object:

        set clone2 = data2.recordset.clone

Jeff Fields


http://lonestar.texas.net/~jkfields/

 
 
 

Cloning problem -- please please please help

Post by Bob Rossn » Wed, 02 Oct 1996 04:00:00



>I am trying to make a clone of a snapshot-type recordset in VB4 16-bit under
>Win 3.11.  The recordset is in a datacontrol (Data2).  I want to make a clone
>of it to search for the selected item in a DBList.  I need to use a clone so I
>don't change the bookmark of the recordset in the list.  I used the following
>code:
>...
>Dim Clone2 as Recordset
>Clone2 = Data2.Clone
>...
>At run time, I get the error "Argument not optional" with "Clone2 = "
>highlighted.  I tried changing Data2.Clone to Data2.Recordset.Clone and got an
>error (Method or data member not found, with ".Recordset" highlighted.  I
>tried adding Dim Data2 as Recordset before the clone command (which I don't
>think is necessary because the recordset already exists in the datacontrol at
>startup, but I tried anyway).  Still no luck.
>What am I missing?

The syntax you're looking for is:

   Set Clone2 = Data2.Recordset.Clone()

At least, that's what the example in the help has.

Bob Rossney