in reply to Re: Re: A Question on ADO and a comment on Microsoft
in thread A Question on ADO and a comment on Microsoft

As for doing this strictly with SQL, I talked to a couple people and they cringed. The information they gave me is that without using ADO, @@IDENTITY isn't set when you're interfacing MS Access. What they actually do is requery for the record they just inserted and pull the number that way.

As far as using ADO, you're going to make something just as unportable as writing ASP. But if you want to try it, you will infact use Win32::OLE. Example..

use Win32::OLE; my $rs = new Win32::OLE("ADODB.Recordset"); # you're going to have to define your consts that # you're using in the vbscript example $rs.Open('NOTICE', etc.. ); $rs->AddNew(); $rs->{'title'}{'Value'} = $somevalue; <....> $rs->Update(); my $last_id = $rs->{'ID'}{'Value'};
written off the cuff so knowing me there's errors, but that's the basic usage under Win32::OLE.

Hope this helps..
Rich

Replies are listed 'Best First'.
Re: Re: Re: Re: A Question on ADO and a comment on Microsoft
by simon.proctor (Vicar) on Jul 21, 2001 at 01:39 UTC
    Thanks for all your help guys

    I'll be trying this ASAP
Re: Re: Re: Re: A Question on ADO and a comment on Microsoft
by simon.proctor (Vicar) on Jul 21, 2001 at 02:38 UTC
    The portabilit issue s certainly true :). But my specific code is in one function in one file and I know about it and I know how to replace it once I use better RDBMS like MySQL or SQLServer.

    Its sad to make this kind of tradeoff though :P

    BTW - apologies for the double post. This thread seems to be cursed. Guess its the Microsoft link. . . . yeah thats it . . . . /me runs and hides