RE: Identify Autonumber field using VB6

From: Eric (Eric_at_discussions.microsoft.com)
Date: 08/23/04


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.
>



Relevant Pages

  • Identify Autonumber field using VB6
    ... I am reading the database schema information for an access database using ... I get all the relevant information except the autonumber field. ... Dim rs111 As ADODB.Recordset ...
    (microsoft.public.data.ado)
  • Identify Autonumber field using VB6
    ... I am reading the database schema information for an access database using ... I get all the relevant information except the autonumber field. ... Dim rs111 As ADODB.Recordset ...
    (microsoft.public.vb.database.ado)
  • RE: Identify Autonumber field using VB6
    ... "Amit Dandavate" wrote: ... > I am reading the database schema information for an access database using ... I get all the relevant information except the autonumber field. ...
    (microsoft.public.data.ado)
  • Auto numbering
    ... After importing all my data into a new Access database, ... decided that I would like to have an autonumber field. ... >From my reading it appears that you cannot add one after ...
    (microsoft.public.access.tablesdbdesign)
  • Autonumber duplication between tables on the desktop and a PDA
    ... PC running in Windows Mobile 2005. ... The mobile database is built using Visual ... two possible scenarios for specifying separate ranges for Autonumber fields ... data on the desktop device it starts the autonumber field at the next ...
    (microsoft.public.access.tablesdbdesign)