Hi,
I have a problem using SESSION variables.
Tables:
Fac
--IdFac [Primary Key]
--CustID
FacDetail
--IdFac [Foreign Key with Fac]
PriceByCust
--CustId
--Price
I use a master detail relation between them, and i show the master info in the detail page.
On the ListOnLoad Event of the detail page i use the following code:
set rstmp = Server.CreateObject("ADODB.Recordset")
rstmp.open "select * from Fac where IdFac = " & SESSION(strTableName & "_masterkey1"), dbConnection
Session("MField2") = rstmp("CustId")
rstmp.close : set rstmp = nothing
At the detail page, a Lookup wizard with the table PriceByCust use the SESSION("MField2") in the Where as follow: [" CustId = " & Session("MField2")]
The problem is that at run time it displays:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Extra ) in query expression '[IdProducto] = 8 and ( CustId = )'.
/Project2/FacDetail_list.asp, line 692
The way i found to fix it is to create a new record in the Fac table and clic on FacDetail link to see an empty detail, and then it works fine.
Any idea of what is happening?
Many thanks