RDO: Connecting to SQL server table containing an identity column 
Author Message
 RDO: Connecting to SQL server table containing an identity column

Does anybody know how to open a rdoResultset to a SQL server table
containing an identity column without using a RDO or DAO control?

Thanks in advance!

Mark



Thu, 05 Aug 1999 03:00:00 GMT  
 RDO: Connecting to SQL server table containing an identity column


Fri, 19 Jun 1992 00:00:00 GMT  
 RDO: Connecting to SQL server table containing an identity column

The following code will get your data and return it in a variant as a
multi-dim array.  You don't need to do that you could just do whatever it
is you want with the data right after the OpenResultset() function.  Also
the assumption is that you have a global connection handle defined as
'ghConn'.

Public Function GetData(zToolID as string, vData as variant)
dim zSQL as string

    Dim rs As rdoResultset

    On Error GoTo ERRDB

    zSQL = "SELECT iID, szALTX, bitAL_State, bitRequired "
    zSQL = zSQL + "FROM tblAlarms "

    rdoErrors.Clear
    Set rs = ghConn.OpenResultset(Name:=zSQL, Type:=rdOpenStatic,
LockType:=rdConcurReadOnly)

    If rs.RowCount > 0 Then
        vAlarms = rs.GetRows(rs.RowCount)
        GetData = SUCCESS
    Else
        GetData = NO_RECS
    End If
    rs.Close

End Function

Tom



Quote:
> Does anybody know how to open a rdoResultset to a SQL server table
> containing an identity column without using a RDO or DAO control?

> Thanks in advance!

> Mark



Fri, 06 Aug 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. RDO, SQL Server and IDENTITY columns

2. Run time error 3622: OpenRecordSet: SQL server table: IDENTITY column

3. Reset Identity Column in SQL Server table with VB

4. OpenRecordset and SQL Table w/ IDENTITY Column

5. SQL SERVER + IDENTITY column + DbSeeChanges PROBLEM

6. SQL Server/VB (Identity Column)

7. VB 4.0 & SQL Server 6.5 (Identity Column)

8. Getting Identity column in SQL Server

9. SQL Server AddNew Identity Column

10. ADO 2.0, SQL Server 7.0, ServerSide cursors, IDENTITY columns after rs.AddNew

11. Programatically drop IDENTITY column in SQL Server?

12. VB, SQL Server, RDO, ODBC and Timestamp column manipulation

 

 
Powered by phpBB® Forum Software