Here is what I'm trying to do...
Open a recordset (the code is more complex this is only one possible
path)
if it is an empty recordset then add a new record, and put values in
that record, update that record, and finally grab the autonumber value
for use in the next block of code.
'OPEN db
Set objConn = Server.CreateObject("ADODB.Connection")
path = server.MapPath("TCSDB.mdb")
objConn.Open = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
path
'set up recordset
set rsPutStaticCostSheetFields =
server.createobject("adodb.recordset")
strSQL = "select * from CostSheets"
rsPutStaticCostSheetFields.open strSQL, objConn, 2, 2
'oh its a new record. recordset has correct table / columns open
rsPutStaticCostSheetFields.addNew
'add new column values
rsPutStaticCostSheetFields.update
'TRY TO GET AUTONUMBER FIELD (FIRST COLUMN CALLED "CostSheetID")
tmpCostSheetID = rsPutStaticCostSheetFields("CostSheetID")
response.write(tmpCostSheetID&"<-- first try<br>")
tmpCostSheetID = rsPutStaticCostSheetFields.Fields.Item("CostSheetID")
response.write(tmpCostSheetID&"<-- second try<br>")
tmpCostSheetID = rsPutStaticCostSheetFields(0)
response.write(tmpCostSheetID&"<-- third try<br>")
tmpCostSheetID = rsPutStaticCostSheetFields("CostSheetID").value
response.write(tmpCostSheetID&"<-- fourth try<br>")
rsPutStaticCostSheetFields.close
...
<-- first try
<-- second try
<-- third try
<-- fourth try
I see no values. Any ideas? Am I using the wrong kind of cursor to
access the access database?
Thanks in advance for your help.
Greg.
"Sometimes we need to kick at the darkness till it bleeds daylight"