Re: Best way to find ID of new record



John wrote on Wed, 22 Mar 2006 09:49:29 -0800:

Thanks Dan. I will look into using a "Transaction on the Connection" to
avoid the problem you mention.

I studied my original question on MSDN and found the answer I needed (not
necessarily the question I asked). I said I used an mdb file but did not
mention that I also, in other applications, utilize SQL Server. I'm pretty
sure now that the code I listed will work with an access db but will not
work with SQL Server. That was what was confusing me. I have developed my
applications utilizing ADO and Queries in such a way that I might adapt to
either a mdb file or SQL Server by changing the provider part of the
connection string. Interestingly this is the first specific difference
(and incompatability) I have found between using an MDB file or SQL
Server. But studying MSDN Article 221931 raised some other questions. The
sample code lists the following:
objRS.Open "SELECT * FROM Customers", objConn, adOpenStatic,
adLockOptimistic AND THEN
objRS.AddNew
And ADO help says adOpenStatic is read only!

Strange.

As to dealing with SQL Server, I use adOpenKeyset with adUseServer and my
own version of the code you posted (pretty much the same) and it works fine.
I've moved almost all my applications to SQL Server with little or no code
modification.

Dan


.



Relevant Pages

  • Re: Is the msdn sql enterprise 2005 version downloadable productio
    ... agreement, the MSDN downloadable SQL Server 2005 Enterprise Edition and the ... 'boxed' SQL Server 2005 Enterprise Edition are exactly the same. ... there is no artificial limitation built into the MSDN copy. ... While the whole licensing issue might ...
    (microsoft.public.sqlserver.setup)
  • Re: Technical Resources page on SQL Server Web site revised
    ... I definitely appreciate the more clear distinction between TechNet and MSDN. ... > In an effort to make it more clear that technical content for SQL Server ... > feedback you might have as a response to this thread. ...
    (microsoft.public.sqlserver.server)
  • Re: Is the msdn sql enterprise 2005 version downloadable productio
    ... I managed to go to the MS enterprise volume licensing site and check the ... downloads for the SQL Server family. ... past production install was done with an MSDN version, ... "Linchi Shea" wrote: ...
    (microsoft.public.sqlserver.setup)
  • Re: SQL Server connection string works with IIS 5.1 but not IIS 6 in ASP.NET
    ... > Do you have an evaluation copy of SQL Server 2000 which expired? ... This is an MSDN Univ. sub. ... did you turn off connection pooling? ... > Carl Prothman ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: MSDE Help
    ... You can install the Developer Edition of SQL Server. ... It should be on your MSDN disks. ...
    (microsoft.public.fox.programmer.exchange)

Loading