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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to populate data from db into data component?

Status
Not open for further replies.

jcrtektip

Technical User
Mar 3, 2004
18
SG
I am using access database. The following is the code used to connect to the database
'*********
strConn = "DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=c:\XXXX.mdb;pwd=xxxx;"
Set conn = New ADODB.Connection
Set adors = New ADODB.Recordset
Set updateuser = New ADODB.Recordset
conn.Open (strConn)
Set adors.ActiveConnection = conn
'***********

How can I populate data from this 'adors' recordset into a data component?

Set Data1.Recordset = dbAccess.OpenRecordset("select * from table1")
 
You have to set the components binding to the adors

Datasource = adors
Datafield = Your Field


Nick
 
This gives an error 'Invalid use of property'

I changed my code as follows...
set data1.datasource = adors

It says method not found
 
yes your rigt sorry!! i tought you were going to bind it at design time!

You should also set the datamember!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top