Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 29th, 2003, 07:24 AM
Authorized User
Join Date: Nov 2003
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to bind text box to recordset fields?

I am a new in using Visual Basic.

I am trying to use ADODB instead of ADODC in display a set of records to text box or table. Besides displaying records, updating, modifying and deleting are also able in order to manupulate those records.

I heard that by binding text box is able to do that. however, i got no idea on how to do it after so many tried.

Hope can get help from expertise.

Advanced thanks.

Reply With Quote
  #2 (permalink)  
Old November 30th, 2003, 10:24 AM
Authorized User
Join Date: Jun 2003
Location: , FL, USA.
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts

For your ADODC1 control set your .ConnectionString and .RecordSource. The .ConnectionString will tell VB what OLE DB driver to use and what database to read from. The .RecordSource will tell VB what table to use from the database. In your text box you need to set the .DataSource to the name of you ADODC1 control and the .DataField to the field you want to view.

Kenny Alligood
Reply With Quote
  #3 (permalink)  
Old December 1st, 2003, 02:10 AM
Friend of Wrox
Join Date: Oct 2003
Location: Cairo, , Egypt.
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000

another way to bind textfield to field data... use databinding collection this sample is from MSDN

dim bmCustomers As New BindingCollection
' Assuming an ADO Data Control configured to connect to the Customers
' table. The TextBox is named Text1; the code binds the CompanyName
' field to the Text property.

Private Sub UserForm_Initialize()
   Set bmCustomers.DataSource = ADODC1
   BmCustomers.Add TextBox1, "Text", "CompanyName"
end sub

Ahmed Ali
Software Developer
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
bind recordset to field ibgreen SQL Language 0 October 24th, 2006 12:48 PM
Bind datagrid to recordset MAntis_sg Classic ASP Databases 0 May 15th, 2006 07:31 AM
Adding Fields to a Text Box Question ausmoran BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 December 1st, 2005 06:15 PM
Populating text box from RecordSet ersp Access VBA 5 April 4th, 2004 08:52 PM
Populating a text box from a RecordSet ersp Access 1 April 4th, 2004 04:22 PM

All times are GMT -4. The time now is 10:46 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.