borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (parameter in dataenviroment designer.)Next Topic (How can I hide a column in a DataGrid?) New Topic New Poll Post Reply
AndreaVB Forum : Database : Adodc and flexgrid how to connect:(
Poster Message
smileii
Level: Trainee

Registered: 19-10-2006
Posts: 2

icon Adodc and flexgrid how to connect:(

hi dears i'm new here, i'm doing a softwaer for my company and i have an adodc control attached to some text fields, one of the text fields(ex:location)may have more than one value with the same name and my company askd me to make it as follow:

when u type in the location field and press enter it should check if the value in the field exisit more than onece if it dose it should cralte a flexgrid to show the records of the search key location which they r more than one. but if it is one only its easy it come by it self.

my code is:

Private Sub Text3_KeyPress(KeyAscii As Integer)


If KeyAscii = 13 Then
Dim SQL As String
''Adodc1.Recordset.Update
'This specifies the SQL to be executed
SQL = "select * from PPD where location='" & Text3.Text & "'"
'This specifies that the type of the ADODC is for SQL
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = SQL
'Adodc1.refresh
If Adodc1.Recordset.RecordCount > 1 Then

''Adodc1.Recordset.MoveFirst

MsgBox "THIS LOCATION NO. CONTAINS MORE THAN ONE RECORD DO YOU WANT TO SEE ? "

''Adodc1.Recordset.MoveLast

Set frmppdsame.grdvalues.DataSource = frmppd.Adodc1


End If




End If
End Sub


i know its wrong..cos i dont know how to join the adodc with the flexgrid. and pls show how to do it in data grid to.
sorry for the long article.

right now it gives me error '91', whenever i change the condition to "= 1" nothnig happens and the msg dosnt come..pls hel

19-10-2006 at 08:11 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : Adodc and flexgrid how to connect:(
Previous Topic (parameter in dataenviroment designer.)Next Topic (How can I hide a column in a DataGrid?) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder