What is wrong with my code?
The 'MB' database had 20 fields, but the only thing that will be added to the listbox is 20x 'ADODB.Internalfield'
Please help me
VB Code:
Dim objConn As ADODB.Connection = New ADODB.Connection() Dim objRs As ADODB.Recordset = New ADODB.Recordset() Dim i As Integer objConn.ConnectionString = "Provider=SQLOLEDB;data Source=CC200392-B; Initial Catalog=MB;User Id=sa;Password=***;" objConn.Open() objRs.Open("Select * from Users", objConn, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockOptimistic) For i = 0 To objRs.Fields.Count - 1 ListBox1.Items.Add(objRs.Fields(i)) Next objRs.Close() objRs = Nothing objConn.Close() objConn = Nothing





Reply With Quote