Strings as Recordsets

Strings as Recordsets

Post by Tom Jo » Sun, 09 Jan 2000 04:00:00



Hi,

Is there any way to use the contents of a string to look up a
recordset field, for example:

rsString = "adoRecordset"

Text1.Text = rsString!dbField

I am a bit of a newbie to this so any suggestions would be greatly
appreciated.

Thanks,

Tom

 
 
 

Strings as Recordsets

Post by Dan Billingsle » Sun, 09 Jan 2000 04:00:00


I don't really know if what you want to do is possible.

But I do know that you can create ADO recordsets out of thin air (not
necessarily retrieved from a database), which may accomplish what you want.


Quote:> Hi,

> Is there any way to use the contents of a string to look up a
> recordset field, for example:

> rsString = "adoRecordset"

> Text1.Text = rsString!dbField

> I am a bit of a newbie to this so any suggestions would be greatly
> appreciated.

> Thanks,

> Tom


 
 
 

Strings as Recordsets

Post by Tom Jo » Sun, 09 Jan 2000 04:00:00


Thanks, however I am trying to use the same function/sub which works
with a ADO recordsets, referencing the correct recordset with the
procedure call, for example:

Call adoUpdate(adoRecordsetName)

Public Sub adoUpdate(adoRecordset As String)

     With adoRecordset
        .Update
             ...etc
             ...etc
     End With

End Sub

I have noticed the the adoRecordsetName can be declared as a
Recordset, but cannot get any joy.

Any ideas?

Thanks,

Tom



>I don't really know if what you want to do is possible.

>But I do know that you can create ADO recordsets out of thin air (not
>necessarily retrieved from a database), which may accomplish what you want.



>> Hi,

>> Is there any way to use the contents of a string to look up a
>> recordset field, for example:

>> rsString = "adoRecordset"

>> Text1.Text = rsString!dbField

>> I am a bit of a newbie to this so any suggestions would be greatly
>> appreciated.

>> Thanks,

>> Tom

 
 
 

Strings as Recordsets

Post by steve » Wed, 12 Jan 2000 04:00:00


why don't you just send the recordset instead of the string?

Such as.....
Private Sub Main

    ' Call Update
    adoUpdate adoRecordset
End Sub

Public Sub adoUpdate(adoRecordset as ADODB.Recordset)

    With adoRecordset
        .etc
        .etc
        .Update
    End With
End Sub

Steve McGovern
Healthmaster, Inc.


> Thanks, however I am trying to use the same function/sub which works
> with a ADO recordsets, referencing the correct recordset with the
> procedure call, for example:

> Call adoUpdate(adoRecordsetName)

> Public Sub adoUpdate(adoRecordset As String)

>      With adoRecordset
> .Update
>              ...etc
>              ...etc
>      End With

> End Sub

> I have noticed the the adoRecordsetName can be declared as a
> Recordset, but cannot get any joy.

> Any ideas?

> Thanks,

> Tom



> >I don't really know if what you want to do is possible.

> >But I do know that you can create ADO recordsets out of thin air (not
> >necessarily retrieved from a database), which may accomplish what you
want.



> >> Hi,

> >> Is there any way to use the contents of a string to look up a
> >> recordset field, for example:

> >> rsString = "adoRecordset"

> >> Text1.Text = rsString!dbField

> >> I am a bit of a newbie to this so any suggestions would be greatly
> >> appreciated.

> >> Thanks,

> >> Tom