Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21725

how to get the data on a text box?

$
0
0
hi,
i am trying to get a specific record to a number of textboxes from ms access database. but iam not able to do that. please help me here is the coding which i am trying to do. many thanks

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Set cn = Nothing
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\user\Desktop\NEW DB\FAITH.mdb;Persist Security Info=False"
cn.Open
Set rs = New ADODB.Recordset
rs.ActiveConnection = cn
rs.Source = (" SELECT * FROM FAITH WHERE EMPLOYEE_ID = ' " & Form2.Text1.Text & " '")
rs.Open
Text1.Text = rs.Fields("S NO").Value
Text2.Text = rs.Fields("FIRST NAME").Value

Viewing all articles
Browse latest Browse all 21725

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>