This topic is locked

Events Add Page

8/8/2007 8:32:57 PM
ASPRunnerPro General questions
K
KingDean author

Sub ListOnLoad()
str = "select Assigned_Tech from Users where User Name='" & Session(strTableName & "_masterkey1") &"'"
Set rsTemp = server.CreateObject("ADODB.Recordset")

rsTemp.open str, dbConnection
Session("Assigned_Tech") = rsTemp("Assigned_Tech")
rsTemp.close : set rsTemp = nothing
End Sub
This is the code i am using to HOPEFULLY get the assigned_tech from the current signed in users profile. Doesn't work and i have looked at it with no answer. ANY help is appreciated.
The users table has the field for Assigned_Tech and User Name

The Work Order Table has a field for entry of an assigned tech, i want this to pull from the users profile the assigned_tech. ?
Thanks for reading, if you have any idea, please post.

Sergey Kornilov admin 8/9/2007

If field name has spaces in it use wrappers.
If your database is MS Access the following will work:

select Assigned_Tech from Users where [User Name]= ...

K
KingDean author 8/10/2007

Sub AddOnLoad()

str = "select Assigned_Tech from Users where '[User Name]' = '" & Session(strTableName & "_masterkey1") &"'"
Set rsTemp = server.CreateObject("ADODB.Recordset")

rsTemp.open str, dbConnection
Session("Assigned_Tech") = rsTemp("Assigned_Tech")
rsTemp.close : set rsTemp = nothing
End Sub
that is the code i am using now, when i do implement the change i get
Error number -2147352567

Error description Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

URL /Laurel Srms/Create_Work_Ticket_add.asp
Let me say what i am doing.
When a user registers, they select there location, when they select that location the system will automatically place the assigned tech for that location in the users table. I need for the above to place in the keyed work order the assigned tech for that users location from the users table. Am i looking at this wrong?
The prefered method would be for the locations table to automatically place the default assigned tech from the location they choose on the work order, because in some instances a user could select a location that isn't there default user location and i need for that to actually pull
Here is the following.
I have a locations table that the users table pulls from. In the location table it has the LocId and Name

THe Users table will Display the name of the location, and when they select there location it looks at the location table to get the assigned tech.

WHen they key a work order, they can assign the location of the request, but i need for that table to look back at the locations table and get the assigned tech from it. Can't get that to work.
Thanks so much for being the best asp support there is.

I am not very familiar with joines or session variables, just learn as i go.

If field name has spaces in it use wrappers.

If your database is MS Access the following will work:

K
KingDean author 8/10/2007

Sorry to mention, i am actually using MySQL for Database

Sub AddOnLoad()

str = "select Assigned_Tech from Users where '[User Name]' = '" & Session(strTableName & "_masterkey1") &"'"
Set rsTemp = server.CreateObject("ADODB.Recordset")

rsTemp.open str, dbConnection
Session("Assigned_Tech") = rsTemp("Assigned_Tech")
rsTemp.close : set rsTemp = nothing
End Sub
that is the code i am using now, when i do implement the change i get
Error number -2147352567

Error description Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

URL /Laurel Srms/Create_Work_Ticket_add.asp
Let me say what i am doing.
When a user registers, they select there location, when they select that location the system will automatically place the assigned tech for that location in the users table. I need for the above to place in the keyed work order the assigned tech for that users location from the users table. Am i looking at this wrong?
The prefered method would be for the locations table to automatically place the default assigned tech from the location they choose on the work order, because in some instances a user could select a location that isn't there default user location and i need for that to actually pull
Here is the following.
I have a locations table that the users table pulls from. In the location table it has the LocId and Name

THe Users table will Display the name of the location, and when they select there location it looks at the location table to get the assigned tech.

WHen they key a work order, they can assign the location of the request, but i need for that table to look back at the locations table and get the assigned tech from it. Can't get that to work.
Thanks so much for being the best asp support there is.

I am not very familiar with joines or session variables, just learn as i go.

Sergey Kornilov admin 8/12/2007

select Assigned_Tech from Users where `User Name`= ...

K
KingDean author 8/12/2007

select Assigned_Tech from Users where `User Name`= ...


I will be posting this to your demo site.
Will include connection info in e-mail. Thanks for you time. Sunday work is just to much isn't it.