|
-
Jun 15th, 1999, 07:43 PM
#1
Thread Starter
New Member
Im trying to display the contents of a recordset in a dbgrid. The data source of the grid is a data control (data1) and Im assigning my recordset to the data controls recordset property. The dbgrid expands vertically to the correct number of rows but no data is displayed.
Does anyone know what im doing wrong???
-
Jun 16th, 1999, 02:09 PM
#2
Thread Starter
New Member
Anyone know how to do this????
-
Jun 16th, 1999, 03:30 PM
#3
New Member
Hai
First set the database name of data1 to the desired database.(ex. Emp.mdb) then recordset property of data1 to the table name you require.
Set the dbgrid datasource to Data1. This will fetch the details of the table you have selected provided you have records in that. so check you have records in the table
------------------
Doing what you like is Freedom ! ! ! !
Liking what you do is Happiness ! ! ! !
-
Jun 16th, 1999, 03:36 PM
#4
Thread Starter
New Member
OK, but the problem is that I want to display results from a SQL statement (eg Only display records where the employee ID matches that specified by the user).
I execute the SQL statement against the database so I have my data in a recordset. The problem is getting the data from the recordset to the dbgrid.
-
Jun 17th, 1999, 06:14 AM
#5
Hyperactive Member
Hi!
sql=" whatever you have "
Set rst=db.OpenRecordset(sql)
Do Until rst.EOF
Data1.Refresh
Data1.RecordSource=sql
rst.MoveNext
Loop
LG
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|