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

The Recordset Object

Status
Not open for further replies.

dellyjm

Programmer
Apr 13, 2000
168
JM
Anyone knows how to manipulate the recordset object using this "command"?

Private Sub cmdConnection_Click()
Dim conn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim fields As Field

Set conn = New ADODB.Connection
conn.Open "Whatever"

Set rs = conn.OpenSchema(adSchemaTables)
conn.Close
MsgBox conn.State


End Sub
 
Not sure if this answers your question, but assuming the code works,
after conn.Close you have a disconnected recordset, rs. You can check
whether rs.eof = rs.bof, that is that rs is empty; you can find out the
number of fields with rs.fields.something. You can maneuver to a
given record number and assign the record's values to variables.
You can order the records with rs.sort = a field name or index number.
When you are done with rs, it should be set to nothing, as should
the other objects.
 
Well I found out wat it does...as it says it finds out the schema for a DB.

Set rs = conn.OpenSchema(adSchemaTables)

Do Until rs.EOF
sCurrentTable = rs!TABLE_NAME
If Mid(sCurrentTable, 1, 3) <> &quot;sys&quot; Then
If (sCurrentTable <> sNewTable) Then
sNewTable = rs!TABLE_NAME
Debug.Print &quot;Current Table : &quot; & rs!TABLE_NAME
End If
Debug.Print &quot; Field: &quot; & rs!COLUMN_NAME
End If
rs.MoveNext
Loop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top