Re: if statement comparing variable

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Mike Haas (mhaas_at_mail.lr.k12.nj.us)
Date: 02/29/04


Date: Sun, 29 Feb 2004 08:38:38 -0800


> if rsArticles("tbl_articles.section_id") = "1" then

>This line is not giving you an error?? Do you have On Error Resume Next
in
>your code? Comment it out. You will see an error generated by this
line. You
>cannot refer to a recordset field using the table name like this.

no errors, i was just missing CInt to make the if work for me. all of
the sql
code is called from a sql.asp file, uses alot of joins. In a few areas
the code
uses the table name. I put this if statement in the results of the
original
designers code so that i could restrict which section to show.
Sorry for the confusion I caused you with my inefficient code (passing
the
section I wanted to view from a form and then restricting the display on
that
page to just the desired results). Yes, i could have rewrote the stored
sql
statement to select my desired section or created a new stored sql to do
so.
But since I already ne the very little amount of data contained in the
table and
how often this page would actually be used, I just wanted a quick fix.
 I think the person who posted the fix to my delima figured out I was
trying to
put a work around in place to make something work, that's why you posted
a
one line fix to my problem.
--------------------------------------
Michael Haas
WAN & Telecom Tech
Lenape Regional High School District

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • Re: Stumped - Level 16 error terminates stored proc
    ... without this fix. ... (The fix claims to be for all levels of SQL Server 2000, ... Capture Error 1222 ... why is it terminating the stored procedure and not allowing me to handle the ...
    (microsoft.public.sqlserver.server)
  • Re: MS03-031 issue
    ... I tried the workaround (set the passwords from another SQL) but am ... Back out the hot fix or apply another fix? ... >> A supported fix is now available from Microsoft, ... call Microsoft Product Support Services so that the ...
    (microsoft.public.sqlserver.security)
  • Re: Controlling System Messages
    ... Microsoft has a "move server" tool that will fix the URL in SQL ... "Approaching SharePoint Web site storage limit", ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: Field Level Security
    ... I agree with Dan that the recommended approach is to use views to restrict ... you can assign permissions to specific columns using ... Enterprise Manager (in SQL Server 2000) or the GRANT/DENY statements (SQL ... individual columns instead of caring only about high level objects such as ...
    (microsoft.public.sqlserver.security)
  • SQL Injection
    ... My server was badly infected by SQL Injection. ... First use the kill char functions to validate proper input. ... j) Code Access Security to Restrict File I/O ...
    (microsoft.public.dotnet.framework.aspnet.security)