R
robert
I cannot get these 'if then else response.write' codes to work can
someone please help
The database, I have two tables (relationship)
contactTBL (one) and membershipTBL (many)
contactTBL - primary key - contactID
membershipTBL - foreign key - contactID
All I want to do is set up a statement that returns a response.write
"no memberhsip on file" if contactID is not in the membershipTBL - ie
if the person has no membership, then their 'contactID' would not
appear in the membershipTBL, and I would like to tell them when they
login that 'You dont have any membership'
Here is some code that may help, the site is protected by the
contactID set as CID:
<%Your_Name = request.cookies("remain")%>
<%Date_In = request.cookies("still")%>
<%CID = request.cookies("CID")%>
<%If request.cookies("remain") = "" then response.redirect
("login.html")%>
<%Dim MyLogin
Set MyLogin = Server.CreateObject("ADODB.Connection")
ConnStr = "DRIVER={Microsoft Access Driver (*.mdb)}; "
ConnStr = ConnStr & "DBQ=" & Server.MapPath("..\fpdb\aata.mdb")
MyLogin.Open(ConnStr)
%>
</html>
<body>
<%dim oRS
Set oRS= MyLogin.execute("Select * From membership_TBL WHERE
contactID=" & CID & "")%>
<%If oRS.EOF = " " AND oRS.BOF = " " then response.write "You have no
membership"%>
--
The error is ADODB.Field error '80020009'
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record
Note there is another connection above this in the code to another
table in the database, that code is:
<%Dim RS
Set RS = MyLogin.execute("SELECT * FROM contactTBL WHERE contactID=" &
CID & "")
%>
Welcome, <%=Your_Name%>
Thanks in Advance
Rob
someone please help
The database, I have two tables (relationship)
contactTBL (one) and membershipTBL (many)
contactTBL - primary key - contactID
membershipTBL - foreign key - contactID
All I want to do is set up a statement that returns a response.write
"no memberhsip on file" if contactID is not in the membershipTBL - ie
if the person has no membership, then their 'contactID' would not
appear in the membershipTBL, and I would like to tell them when they
login that 'You dont have any membership'
Here is some code that may help, the site is protected by the
contactID set as CID:
<%Your_Name = request.cookies("remain")%>
<%Date_In = request.cookies("still")%>
<%CID = request.cookies("CID")%>
<%If request.cookies("remain") = "" then response.redirect
("login.html")%>
<%Dim MyLogin
Set MyLogin = Server.CreateObject("ADODB.Connection")
ConnStr = "DRIVER={Microsoft Access Driver (*.mdb)}; "
ConnStr = ConnStr & "DBQ=" & Server.MapPath("..\fpdb\aata.mdb")
MyLogin.Open(ConnStr)
%>
</html>
<body>
<%dim oRS
Set oRS= MyLogin.execute("Select * From membership_TBL WHERE
contactID=" & CID & "")%>
<%If oRS.EOF = " " AND oRS.BOF = " " then response.write "You have no
membership"%>
--
The error is ADODB.Field error '80020009'
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record
Note there is another connection above this in the code to another
table in the database, that code is:
<%Dim RS
Set RS = MyLogin.execute("SELECT * FROM contactTBL WHERE contactID=" &
CID & "")
%>
Welcome, <%=Your_Name%>
Thanks in Advance
Rob