Identify Autonumber field using VB6
From: Amit Dandavate (Dandavate_at_discussions.microsoft.com)
Date: 08/23/04
- Next message: dan: "ADO generated code disapears"
- Previous message: Bob Barrows [MVP]: "Re: ASP .mdb ADO OLE automation error - but works in access!"
- Next in thread: Eric: "RE: Identify Autonumber field using VB6"
- Reply: Eric: "RE: Identify Autonumber field using VB6"
- Reply: Eric: "RE: Identify Autonumber field using VB6"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 23 Aug 2004 02:03:03 -0700
Hi,
I am reading the database schema information for an access database using
visual basic. I get all the relevant information except the autonumber field.
I have a question as -
How to identify the Autonumber field of Access? similarly
How to identify the Identify field of SQL server?
For populating the database information I am using following code in vb6.
Private Sub PopulateFields(ByVal sTableName As String, ByRef lstList As
ListBox)
'Function added by Amit
On Error GoTo ErrHandler
Dim rs111 As ADODB.Recordset
Dim rsarr() As Variant
Dim iCnt As Integer
s = Array(DataBaseName, Empty, sTableName)
Set rs111 = db.OpenSchema(adSchemaColumns, s)
If Not rs111.EOF Then
rs111.MoveFirst
' Fill array with all Field information for this Table
rsarr = rs111.GetRows
iCnt = UBound(rsarr, 2) + 1
If iCnt >= 1 Then
For i = 0 To iCnt - 1
lstList.AddItem Trim(rsarr(3, i) & "") 'table field name
'Note-Other information can be located in the array.
currently loading only field name and data type id.
lstList.ItemData(i) = Trim(rsarr(11, i) & "")
Next
End If
rs111.Close
Set rs111 = Nothing
End If
Exit Sub
ErrHandler:
MsgBox Err.Number & "-" & Err.Description
End Sub
Please Help me as soon as possible.
Regards,
Amit Dandavate.
- Next message: dan: "ADO generated code disapears"
- Previous message: Bob Barrows [MVP]: "Re: ASP .mdb ADO OLE automation error - but works in access!"
- Next in thread: Eric: "RE: Identify Autonumber field using VB6"
- Reply: Eric: "RE: Identify Autonumber field using VB6"
- Reply: Eric: "RE: Identify Autonumber field using VB6"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|