RE: Identify Autonumber field using VB6
From: Eric (Eric_at_discussions.microsoft.com)
Date: 08/23/04
- Next message: Eric: "RE: Identify Autonumber field using VB6"
- Previous message: Eric: "ADO connection state and object destruction Problem/Question"
- In reply to: Amit Dandavate: "Identify Autonumber field using VB6"
- Next in thread: Eric: "RE: Identify Autonumber field using VB6"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 23 Aug 2004 14:41:03 -0700
Amit, Please see this Q article
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q186246
-Eric
"Amit Dandavate" wrote:
> 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: Eric: "RE: Identify Autonumber field using VB6"
- Previous message: Eric: "ADO connection state and object destruction Problem/Question"
- In reply to: Amit Dandavate: "Identify Autonumber field using VB6"
- Next in thread: Eric: "RE: Identify Autonumber field using VB6"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|