This topic is locked

LoginID where statement

1/13/2008 17:21:33
ASPRunnerPro General questions
R
RICHARD96 author

I have two tables (MS-SQL 2005):
OWNMASTER (Parent) which has a field called LOGINID (smallint)

VNMASTER (Child) which also has a field linked called LOGINID (smallint).
I am trying to use a Lookup table with a 'where' condition so only VNMASTER 'owned' by the logged user (dbo.OWNMASTER.LOGINID) can be seen in the finder.
I am using the following
Table VNMASTER

Link Field VENID
The Where statement I am trying to use is as follows:
LOGINID=SESSION("_OWNMASTER_OwnerID")
This is giving an error 'Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.'
Can anyone help with this one?
Thanks,
Richard.

R
RICHARD96 author 1/14/2008

Further to my previous post I can get the following to work in my where statement
"LOGINID = 1"
This returns all VNMASTER with a LOGINID of 1
I can also get the following to appear in the same screen as a read only LOGINID to commit to the database upon adding a VNEVENT:
Session("_" & strTableName &"_OwnerID")
This also returns 1
How do I combine the two so I only populate the Select list where LOGINID from VNMASTER is eual to the current user LOGINID?

Sergey Kornilov admin 1/15/2008

Try the following:

"LOGINID = " & Session("_" & strTableName &"_OwnerID")
R
RICHARD96 author 1/16/2008

Thanks for that Sergey. Works a treat.
The only problem is that when I login as 'Guest' and 'hover' over the link I get no 'popup' details of the event (this feature works fine when I actually login with a valid ID). When I click on the event link I get the following error.
Error Type:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)

[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near ')'.

/vevent_list.asp, line 626
Any ideas how I can get around this one?