Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

Re: FN-FORUM ASP & Access Query

date posted 1st September 2001 16:18

Cheers Norman,

You described my problem perfectly....lol

I'll give that a go.

Jon
----- Original Message -----
From: "Norman Beresford" [EMAIL REMOVED]
To: [EMAIL REMOVED]
Sent: Saturday, September 01, 2001 1:41 PM
Subject: Re: FN-FORUM ASP & Access Query


> Hi Jonathan
>
> As no one else has answered, and I'm in work I thought I'd take a stab at
> helping you out!
>
> Now my understanding of the problem is that you want people to add a pub
and
> then go straight to adding a review for the pub. The problem you seem to
> have is retriveing the Primary ID of the pub once it's been entered into
the
> database. Now this is actually quiet easy. What you have to do is use a
> different type of cursor, instead of using a forward-only cursor (the
> default), you need to use a Keyset cursor. What this will do is allow you
to
> return data from a recordset, after you've written to it.
>
> I assume that you're using a recordset to update your database, so your
code
> will look something like this:
>
> Set updateRS = server.createObject("ADODB.Recordset")
> updateRS.Open "tableName", "DSN", , ,adCmdTable
> updateRS.AddNew
> updateRS.Fields("pubName") = pubName
> updateRS.Fields("pubAddress") = pubAddress
> updateRS.Update
> updateRS.Close
> Set updateRS = nothing
>
> Now what we want to do is return the primary id to us, so we'll slightly
> modify the code above. This is assuming that you're including the
> ADOVBS.inc file with the page
>
> Set updateRS = server.createObject("ADODB.Recordset")
> updateRS.Open "tableName", "DSN", adOpenKeySet,
adLockPessimistic,adCmdTable
> updateRS.AddNew
> updateRS.Fields("pubName") = pubName
> updateRS.Fields("pubAddress") = pubAddress
> updateRS.Update
> pubID = updateRS.Fields("PrimaryID")
> updateRS.Close
> Set updateRS = nothing
>
> What happens here is:
>
> 1.Information is written to the recordset
> 2.The recordset is updated, putting the information into the database.
But
> this time it also fetches out any new information (in this case the
Primary
> ID field).
> 3.We assign the new information to a variable
>
> This means that we now have the Primary ID for the pub we've just created.
> We can then use this to generate an appropriate review page for that pub.
>
> HTH, and if you need any help with it just give me a yell
>
> Norman
>
>
>
> > When the pub isn't listed user can add them. However they aren't taken
to
> > the actual review form
> > afterwards. Is there anyway of after submitting knowing the Primary Id
of
> > the pub they've entered
> > and redirecting them to a review form which will know which pub to add
it
> > too?
> >
> > Thank everyone. Feel free to test it and see... make sure the pub name
is
> > obvious.
>
>
>
> *********************** Tight Briefs ***********************
>
> Tight Briefs is a new, soon to be launched, remote working
> projects service from Freelancers.net
>
> Clients post their tightly defined briefs, choose a price
> and freelancers are invited to apply.
>
> All client to freelancer contact is handled by us.
>
> More details: http://www.freelancers.net/tightbriefs.html
>
> ============================================================
>
> * Free listing for freelancers
> * Free to advertise jobs
> * Free jobs distribution service
> * Free database of 1000 freelancers
>
> Freelancers and Freelance Jobs
> http://www.freelancers.net
>
> To post to the Forum:
> [EMAIL REMOVED]
>
> To unsubscribe please email:
> [EMAIL REMOVED]
>
> To unsubscribe from the digest please email:
>
> [EMAIL REMOVED]
>
> If you have difficulties unsubscribing please email:
> [EMAIL REMOVED]
>
> To subscribe to the digest for this list or for further information please
visit:
> http://www.freelancers.net/forum.html



Messages by Day
September 30th 2001
September 29th 2001
September 28th 2001
September 27th 2001
September 26th 2001
September 25th 2001
September 24th 2001
September 23rd 2001
September 22nd 2001
September 21st 2001
September 20th 2001
September 19th 2001
September 18th 2001
September 17th 2001
September 16th 2001
September 15th 2001
September 14th 2001
September 13th 2001
September 12th 2001
September 11th 2001
September 10th 2001
September 9th 2001
September 8th 2001
September 7th 2001
September 6th 2001
September 5th 2001
September 4th 2001
September 3rd 2001
September 2nd 2001
September 1st 2001


Messages by Month
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
January 2001


Messages by Year
2008
2007
2006
2005
2004
2003
2002
2001
2000