Re: Different @@SPID for same user/connection ?!?!?!

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hans,

I've never taken this approach.

Do you create the temp tables "on the fly"?

If so, you could create temp tables named after the current user?

If not, why not cache the top-level @@SPID in a program variable and pass it into all your stored procs/view that create/load/move
the records?

I really don't understand your application well enough to make reasonable suggestions....

Good luck. At least now you know why you were getting different values for the @@SPID.

Oh, you also might consider, instead of having subforms, to have two main forms and make the 2n'd be dependent upon the 1st (i.e. in
the "on current" of the 1st, set a hidden form variable which is used to parameterize the query/stored proc of the 2nd form).

Malcolm

"hpesata" <hpesata@xxxxxx> wrote in message news:1179930973.987838.160240@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Malcolm!

Do you have subforms? If so, then heed these words: "Unlike with other database objects, Access does not always use the same
connection to retrieve the data source of a subform." -http://support.microsoft.com/kb/308312
What is the effect you are trying to acheive by using @@SPID?

thanx for your reply!

yes, I am using subforms and I realized that sometimes my subformy use
a different @@SPID
than the main form, but this doesnt happen with all my forms.

the main-form is usually used to scroll/create/delete records,
the sub-forms display the contents of a specific record.

I am using (temporary) tables where I load a record into, when a user
edits it.
my sub-forms are bound to this temporary tables.
after he finished editing I update it in the real table if he wants to
save the changes.

I am using views to bind the content of a user-specific record to my
form, in this view
I use @@SPID, also in the stored procedures which I use to load/save
records.

therefore I have to store a specific ID for every user within the
records of my temporary table,
to correctly edit/assign user-specific data.

do you have any idea how I can successfully accomplish this ???

regards,
Hans



.



Relevant Pages

  • Re: how to create/use temp table on the fly?
    ... Using the SPID idea, use: ... Columnist, SQL Server Professional ... data to a temp table to compare a date and ID fields to ... >Excel - on the fly. ...
    (microsoft.public.sqlserver.programming)
  • Help with Master/Detail UI in ADPs
    ... temp table for the Detail rows with OK, Apply and Cancel buttons on these ... from the unbound fields to the Master table on the server and from the local ... bind it to the Detail subform. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Different @@SPID for same user/connection ?!?!?!
    ... you could create temp tables named after the current user? ... why not cache the top-level @@SPID in a program variable and pass it into all your stored procs/view that create/load/move the records? ... Oh, you also might consider, instead of having subforms, to have two main ... the sub-forms display the contents of a specific record. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Unbound Nested Subform Simulating Continuous Form
    ... Have included temp table and array in options for converting from the ... Optionbuttons & Checkboxes entries/combinations. ... subform to form the record to ...
    (comp.databases.ms-access)
  • Re: auto fill records in a form
    ... I would use a temporary table with 24 records, 3 fields, the HourEnding ... Use that temp table as subform (if ... > When I create a new transaction, ...
    (microsoft.public.access.formscoding)