what does select @@identity do?

Posted by every_answer_gets_a_point on Stack Overflow See other posts from Stack Overflow or by every_answer_gets_a_point
Published on 2010-05-12T19:48:15Z Indexed on 2010/05/12 19:54 UTC
Read the original article Hit count: 162

Filed under:
|
|
|
|

i am connecting to a mysql database through excel using odbc

what does this line do?

Set rs = oConn.Execute("SELECT @@identity", , adCmdText)

i am having trouble updating the database:

   With rs
        .AddNew ' create a new record
        ' add values to each field in the record
        .Fields("datapath") = dpath
        .Fields("analysistime") = atime
        .Fields("reporttime") = rtime
        .Fields("lastcalib") = lcalib
        .Fields("analystname") = aname
        .Fields("reportname") = rname
        .Fields("batchstate") = "bstate"
        .Fields("instrument") = "NA"
        .Update ' stores the new record
    End With

it is ONLY updating .Fields("instrument") = "NA", but for all other fields it is putting NULL values

© Stack Overflow or respective owner

Related posts about sql

Related posts about mysql