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.
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
you can dim TotalUsers and TotalAdmins as integer in the top or you can do TotalMembers = cint(TotalUsers) - cint(TotalAdmins)
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