Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Controls linking to ADODB.Recordset 1

Status
Not open for further replies.

mmilan

Programmer
Joined
Jan 22, 2002
Messages
839
Location
GB
I've heard it's possible to link controls to a recordset object directly - in the same way that you might link controls to a data control.

Does anyone know anything about this?

Cheers chaps!

Martin
 
In run time you would have to initialize the controls when you set your recordset. i.e.
[tt]
'Place this after you get your recordset
Form1.TextBox1.DataSource = rs!RecordID
'Or you could use
'Form1.TextBox1.DataSource = rs.Field(1)

[/tt] Craig, mailto:sander@cogeco.ca

"Procrastination is the art of keeping up with yesterday."

I hope my post was helpful!!!
 
Wow - I didn't think it would be that simple... Cheers Craig - I'll give that a try...

And you've been marked as a helpful post...

 
It didn't show as helpfull. When you post things as helpfull it brings up a little window, you have to click that link on the pop-up to confirm. That messed me up the first 5 times I marked people as helpful too.

Note to Web Master I guess... Craig, mailto:sander@cogeco.ca

"Procrastination is the art of keeping up with yesterday."

I hope my post was helpful!!!
 
Are you sure about that code Craig? I just remember that DataSource is only writable at design time from a previous project...

I'll still give it a bash though - snowed under with work at the moment:o(

Cheers again though - much appreciated.

Martin.
 
Hi Guys,
I think that in order for this to work, you have to set the CursorLocation before you open the recordset:

Dim rs as New ADODB.Recordset
rs.CursorLocation = adUseClient (or something like that)
rs.open "select....

Set DataGrid1.DataSource = rs

I believe that you can possibly get away with setting the CursorLocation for the Connection object *instead* of the rs:

conDB.CursorLocation = adUseClient

At least that is the way it worked when I fought this battle 5 or 6 months ago. Using a standalone recordset instead of ADODC seemed to make refreshing the data after updates a lot easier.

Good Luck
Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top