Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formanager DTC and SQL Server 2000 Identity Col

Status
Not open for further replies.

computergeek

Programmer
May 23, 2001
193
CA
Hello,

I have setup a Company table (SQL Server 2000) and have set the company_id column to be an Identity column. Within the recordset DTC on my ASP page I specify a select statement for the company table leaving the company_id out. I am using the Formmanager DTC to enter the data. Sequence of events:

1. Add button is clicked which does a addrecord(), then a movelast(). The entry fields are cleared...

2. Data is entered within textboxes bound to recordset table columns

3. Save button is clicked which does an Updaterecord()

ASP page now goes off into la la land and never returns?! I tried doing a Requery() upon Save just after the updaterecord()... but it made no difference. If this doesn't work soon, we are going to switch to using an insert trigger to manage incrementing the ID, or ditch the Formmanger DTC. Does anyone know what is happening? And better yet what to do to fix it?

Thanks in advance for the information.
 
Hi,

I figured it out...it's a bug! For those that experience this problem or a similar problem, see document Q190591 within Microsoft's knowledge base of Visual Interdev.

Computergeek

 
Hi,

It's me, Computergeek. Microsoft has a work around... but it is very annoying. If you do an add and the table has an identity column they say to do a requery() after the update. Well, the insert works now, BUT you are placed at the beginning of the record set and not the record you were on?!

One thought I had was to execute a script to get the max ID from the table an then go to that record. Unfortunately, more that one user is likely to be on at the same time. Each user could have a different record set depending on what they are allowed to access... so you see it is not as simple as going to the max ID record.

Any suggestions?

Thanks!
 
It can be easier to create a separate group of unbound input boxes, below and updateable grid, or on a separate page.. Together with an add pushbutton, you can add data without the default recordset behaviour. If you add via a stored procedure, you can very easily get the new ID number back as a parameter, refresh the recordset/grid and position the recordset/grid to the correct row. (Content Management)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top