Hi,
I'm trying to make a message forum using ASP. I have two tables in my database:
ThreadID (Threads table) and PostID (Posts table) are the primary keys; both are Autonumbers.
Adding a new post (ie replying to an existing thread) is easy; just add a new record with the appropriate thread ID.
But what I want to do now is create a new thread; ie. add a new record to the Threads table, then, using the Autonumber key from that new record, add the first post to the Posts table.
The bit in italics of the last paragraph is what I am having trouble with. How can I get the ID of the record I just added, so I can use it to add the new record in the other table?
[Thanks in advance|Hope I helped you]
Exodus300
I'm trying to make a message forum using ASP. I have two tables in my database:
Code:
Threads (ThreadID, Title, StartedBy, StartedDate, StartedTime)
Posts (PostID, ThreadID, PostedBy, PostedDate, PostedTime, Content)
ThreadID (Threads table) and PostID (Posts table) are the primary keys; both are Autonumbers.
Adding a new post (ie replying to an existing thread) is easy; just add a new record with the appropriate thread ID.
But what I want to do now is create a new thread; ie. add a new record to the Threads table, then, using the Autonumber key from that new record, add the first post to the Posts table.
The bit in italics of the last paragraph is what I am having trouble with. How can I get the ID of the record I just added, so I can use it to add the new record in the other table?
[Thanks in advance|Hope I helped you]
Exodus300