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

DataRepeater Problem

Status
Not open for further replies.

bpitche

MIS
Mar 13, 2001
43
0
0
US
I am working on search tool in which I would like to display the query results in a DataRepeater. I built the .ocx ActiveX control, assigned the properties (let and get), and created the bindings. Repeater is linked to an ADODC user control. My problem is that no data is being displayed in the repeater. I know that my recordset contains data because I have a procedure to count how many records are in the set. I doln't get any errors. If anyone has any suggestions, please feel free to share them with me. I really need to figure this out so I can continue with my project.

Brad Pitcher
The Hoover Company
bpitcher@hoover.com
 
are u using the activex on the web or in another vb project?

Known is handfull, Unknown is worldfull
 
I am using the active x in a standard .exe project. I am using an Oracle database. Like I said, there is data in my recordset, because I can view the list in a list box. I just cannot get it to work in the Data Repeater.

Brad Pitcher
The Hoover Company
bpitcher@hoover.com
 
try running the activex control in its own project, does the error still remain?

Known is handfull, Unknown is worldfull
 
I am not getting an error, it is just that my data is not displaying in the repeater. I did run the active x in it's own project and I get an image of form with no data.

Brad Pitcher
The Hoover Company
bpitcher@hoover.com
 
so it means that there is a logical error in the control, try giving the areguments in the ActiveX project and check if it works there.

Known is handfull, Unknown is worldfull
 
Here is my code for the form in which the data repeater exisits. This is where I call my connection string (global variable) and set up the datasource for my ADO data control. Then I set up the Data Repeater (Data1) using code (I have tried this both ways, using the properties and by using the code, neither on works).

Thanks!!


Option Explicit
Dim myRecordset As ADODB.Recordset
Dim myConnection As ADODB.Connection
Dim Counter As Integer

Private Sub Form_Load()

Counter = 0

Adodc1.ConnectionString = gstrConnectionString 'global variable for my connect string
Adodc1.RecordSource = gstrWhereInventory 'global variable for my database query

Set myConnection = New ADODB.Connection
Set myRecordset = New ADODB.Recordset

myConnection.ConnectionString = gstrConnectionString
myConnection.Open
myRecordset.MaxRecords = 1000
myRecordset.Open gstrWhereInventory, myConnection

Set Adodc1.Recordset = myRecordset
ConfigureDataRepeater Data1 'Data1 is my repeater
'myRecordset.Close
'myConnection.Close

Do Until myRecordset.EOF
'frmList.List1.AddItem myRecordset!Description
Counter = Counter + 1
myRecordset.MoveNext
Loop
frmList1.Label1.Caption = Counter & " Records Found"

End Sub

Private Sub ConfigureDataRepeater(Data1 As DataRepeater)
With Data1
Set .DataSource = Adodc1
' Be sure to set the RepeatedControlName before adding
' RepeaterBinding objects to the collection. Otherwise
' the DataRepeater doesn't know what public properties
' are available for binding.
.RepeatedControlName = "controlPrj.pubCtl"
.RepeaterBindings.Add "Itemnum", "ITEMNUM"
.RepeaterBindings.Add "Description", "DESCRIPTION"
.RepeaterBindings.Add "In1", "IN1"
.RepeaterBindings.Add "In2", "IN2"
.RepeaterBindings.Add "Il5", "IL5"
.RepeaterBindings.Add "Binnum", "BINNUM"
.RepeaterBindings.Add "Il4", "IL4"
.RepeaterBindings.Add "Curbal", "CURBAL"
.RepeaterBindings.Add "Issueunit", "ISSUEUNIT"
End With
End Sub


Private Sub Form_Unload(Cancel As Integer)
myRecordset.Close
myConnection.Close
End Sub

Brad Pitcher
The Hoover Company
bpitcher@hoover.com
 
Problem solved!!

Thanks for your help!!

It was the way I was opening my recordset(adUseClient)
(adOpenStatic), etc.

Thanks again,

Brad Pitcher
The Hoover Company
bpitcher@hoover.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top