Prior life – with ADO and ASP
Assumption:
Function in an include file called DBConn creates a database connection
Assuming I am going to do something with that identity field, what is the ASP/ADO.NET equivalent?
Matthew Moran (career blog and podcast below)
Career Advice with Attitude for the IT Pro
Assumption:
Function in an include file called DBConn creates a database connection
Code:
Set cnn = DBConn()
strSQL = “select * from table1”
strSQL2 = “Select * from table2 where id = 0” ‘ will be blank
Set rs1 = cnn.execute(strSQL)
Set rs2 = server.createobject(“adodb.recordset”)
Rs2.open strSQL2, cnn, 1, 3
While Not rs1.eof
Rs2.addnew
Rs2(“field1”) = rs1(“fieldname1”)
Rs2(“field2”) = rs1(“fieldname2”)
Rs2.update
Rs2.movefirst
intIdentityField = rs2(“ID”)
rs1.movefirst
Wend
Assuming I am going to do something with that identity field, what is the ASP/ADO.NET equivalent?
Matthew Moran (career blog and podcast below)
Career Advice with Attitude for the IT Pro