Edit: Nevermind. I figured this out.
How about sharing your solution for future searches?
Here's a solution for SQL Server:
sql = "insert into table(row) values(value) SELECT @@IDENTITY"
Set rs = Conn.Execute(sql).NextRecordSet
NewID = rs(0)
MySQL has a last_insert_id function (for which PHP has a corresponding function, by the way).
PostgreSQL (and perhaps other DBMS's?) has a RETURNING clause you can use with an insert:
INSERT . . . RETURNING table_key_field