What am I doint wrong?

Results 1 to 2 of 2

Thread: What am I doint wrong?

  1. #1
    Join Date
    Dec 1969

    Default What am I doint wrong?

    I have this code:<BR><BR>&#060;% @ Language=VBScript %&#062;<BR>&#060;%<BR>dim nScreenHeight<BR>%&#062;<BR>&#060;SCRIPT Language=VBScript&#062;<BR> Sub asWindow_onload<BR> if screen.height = 480 Then<BR> nScreenHeight = 480<BR> elseif screen.height = 600 Then<BR> nScreenHeight = 600<BR> elseif screen.height = 768 Then<BR> nScreenHeight = 768<BR> elseif screen.height = 864 Then<BR> nScreenHeight = 864<BR> elseif screen.height = 960 Then<BR> nScreenHeight = 960<BR> elseif screen.height = 1024 Then<BR> nScreenHeight = 1024<BR> elseif screen.height = 1200 Then<BR> nScreenHeight = 1200<BR> else<BR> nScreenHeight = "Other"<BR> End if<BR> End Sub<BR>&#060;/SCRIPT&#062;<BR><BR>&#060;%<BR>Call asWindow_onload<BR>objRS.Open "SELECT * FROM Sr WHERE SrType = " & nScreenHeight & ";", conntemp, 3, 3<BR>%&#062;<BR><BR>But I get a type mismatch error.<BR>The script is from AspIn.com. What can I be doing wrong?<BR>

  2. #2
    Join Date
    Dec 1969

    Default Server/Client scripting

    If you are in any doubt about what constitutes client-side scripting and what constitutes server-site scripting, please view the FAQ section in the top-right. Alternatively, buy yourself a decent ASP book. I can suggest one if you need.<BR><BR>Either the person who wrote this script has no idea about internet development, or you are not showing the entire/correct coding.<BR><BR>What is this doing?<BR><BR>You are creating a CLIENT-SIDE VBScript function, which loads in the screen height and sets a CLIENT-SIDE variable to the height of the screen.<BR>You then have a SERVER-SIDE function attempting to call the CLIENT-SIDE function, and using that in the SQL query.<BR><BR>This CANNOT HAPPEN.<BR><BR>Please read up on client-server architecture. The FAQ in the "Nature of Things" section of ASPFAQs is very good.<BR><BR>Craig.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts