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!

Using ADODC control instead of Connection string

Status
Not open for further replies.

mansukh20

Programmer
Mar 11, 2004
14
0
0
GB
Hi Guys,

Im finding difficulty implementing this code using ADODC control component. Any suggestions

Private Sub dbcClassType_Change()
Dim sql As String
sql = "SELECT * FROM RATE WHERE CLASSTYPE = '" & dbcClassType.Text & "'"
Set RS = New ADODB.Recordset
RS.Open sql, CON
CMD.ActiveConnection = CON

baseRate = RS!PRICE
weeklyDiscountRate = RS!WEEKLY
monthlyDiscountRate = RS!MONTHLY
weekendSpecialRate = RS!WEEKENDSPECIAL
txtAmountDue.Text = RS!PRICE
calculatedPrice = 0
End Sub
 
Well, if you want to do it that way then:

Dim sql As String
sql = "SELECT * FROM RATE WHERE CLASSTYPE = '" & dbcClassType.Text & "'"
Set RS = New ADODB.Recordset
RS.Open sql, CON

Set Adodc1.Recordset = RS

But, then you do not need to use the ADO Data Control.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top