B
Bon
Dear all
I have a javascript function which embeds ASP script for inserting data
into database. After the data is inserted database, I select the
maximum id (the latest inserted record id). But, it always select the
previous id. It seems the database hasn't been refreshed after insert a
new row.
my code is like
set objrs = server.createobject("ADO.recordset")
objrs.open "myTableName", objDBConnection
objrs.AddNew
objrs.Fields("ForeignID") = Request("foreignid")
objrs.Fields("FirstName") = Request("firstname")
objrs.Fields("LastName") = Request("lastname")
objrs.Fields("Phone") = Request("phone")
objrs.update
objrs.close
objrs.open "select max("PrimaryID") from tbl_myTable", objDBConnection
No matter I use objrs.refresh or objrs.requery instead of objrs.close.
The database is not refreshed. How can I refresh the database after I
add a new row in it? Please give me some suggestions.
Cheers
Bon
I have a javascript function which embeds ASP script for inserting data
into database. After the data is inserted database, I select the
maximum id (the latest inserted record id). But, it always select the
previous id. It seems the database hasn't been refreshed after insert a
new row.
my code is like
set objrs = server.createobject("ADO.recordset")
objrs.open "myTableName", objDBConnection
objrs.AddNew
objrs.Fields("ForeignID") = Request("foreignid")
objrs.Fields("FirstName") = Request("firstname")
objrs.Fields("LastName") = Request("lastname")
objrs.Fields("Phone") = Request("phone")
objrs.update
objrs.close
objrs.open "select max("PrimaryID") from tbl_myTable", objDBConnection
No matter I use objrs.refresh or objrs.requery instead of objrs.close.
The database is not refreshed. How can I refresh the database after I
add a new row in it? Please give me some suggestions.
Cheers
Bon