ASP Problem ... Server Configuration?

Discussion in 'C#' started by Seandals, Nov 2, 2007.

  1. #1
    Hello All,

    I have a problem with my ASP after switching from one server to another. I made no changes to the code and the code worked just fine on the old server. I've done tons of research and I cant find any answer but the problem is not just one blob of code, its quite a few. The only thing that they all have in common is when a varible is inside of another varible. For example.

    
    Set ActMemb = network.execute("SELECT Count(G_LastLogin) As ActiveMembers FROM Global_Users WHERE G_LastLogin > '"& CurrTime &"'")
    TotalUsers = ActMemb("ActiveMembers")
    
    Set ActAdmin = network.execute("SELECT Count(G_LastLogin) As ActiveAdmins FROM Global_Users WHERE G_LastLogin > '"& CurrTime &"' AND G_AccessMask <> 'Member'")
    TotalAdmins = ActAdmin("ActiveAdmins")
    
    TotalMembers = TotalUsers - TotalAdmins
    
    Code (markup):
    Microsoft VBScript runtime error '800a000d'
    Type mismatch

    /includes/inc_header.asp, line 315

    Line 315 is "TotalMembers = TotalUsers - TotalAdmins"

    
    Set PullAd=network.execute("SELECT Count(AdverID) As TotalAds FROM Ads_Banners WHERE Banner_Avail > '0'")
    TotalBanners = PullAd("TotalAds")
    Randomize
    ShowBanner = INT(RND*TotalBanners)+1
    
    Code (markup):
    Microsoft VBScript runtime error '800a000d'

    Type mismatch

    /includes/inc_ads.asp, line 5

    Line 5 is ShowBanner = INT(RND*TotalBanners)+1

    Ive tried just about everything i can think of. Ive changed the varibles to regular integers and the code executes perfectly. I've ran the SQL queries in command line and in ASP and they all work fine. This has led me to believe that it is a server configuration setting.

    HELP!!!

    Thanks,
    Seandals

    P.S. - The server is a virtual dedicated server running Windows 2003 Server. The database type is MySQL. And we're talking ASP Classic here, unknown version.
     
    Seandals, Nov 2, 2007 IP
  2. Techno_EG

    Techno_EG Peon

    Messages:
    12
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try this

    TotalMembers = int(TotalUsers) - int(TotalAdmins)
     
    Techno_EG, Nov 3, 2007 IP
  3. teraeon

    teraeon Peon

    Messages:
    40
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This became a problem in MySQL 5.0 (maybe 4.1 but I skipped over that version). But Techno is right you have to convert the variable to int after you read from the database when you do a COUNT
     
    teraeon, Nov 3, 2007 IP
  4. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #4
    you can dim TotalUsers and TotalAdmins as integer in the top

    or you can do TotalMembers = cint(TotalUsers) - cint(TotalAdmins)
     
    ludwig, Nov 3, 2007 IP
  5. Seandals

    Seandals Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I tried what you suggested. Now i have the following error.

    Microsoft VBScript runtime error '800a01ca'
    Variable uses an Automation type not supported in VBScript

    /includes/inc_header.asp, line 315
     
    Seandals, Nov 3, 2007 IP
  6. Seandals

    Seandals Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    cInt did it! Thanks alot guys :)
     
    Seandals, Nov 3, 2007 IP
  7. ludwig

    ludwig Notable Member

    Messages:
    2,253
    Likes Received:
    66
    Best Answers:
    0
    Trophy Points:
    225
    #7
    good luck with your projects
     
    ludwig, Nov 3, 2007 IP