Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8940629
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:05:00+00:00 2026-06-15T11:05:00+00:00

I have been working with classic ASP and database access through it. The database

  • 0

I have been working with classic ASP and database access through it. The database im using is MySQL. The ASP pages are running on IIS 7.
I developed two ASP pages. First, here is the schema im working with-

Book = (b_id, title, pages, price, p_id)

Publisher = (p_id, name, country)

p_id in Book is a foreign key from Publisher.

Now, in one script, when adding record in Publisher, i first check whether similar record exists and if it does then report that to user. That script works fine.

But in other script to insert record in Book, i first check whether the specified publisher exists or not. But for some reason, that doesnt work at all. That is, when i query the Publisher table to get all records for comparision, the RecordCount property of the RecordSet object returns -1.

I have checked both scripts extensively for errors and there are none.

Why is the same code for the same purpose not working in one but working in the other ?

The working code –

flag = false
temprs.Open "select country from publisher where name='" & pubname & "'", conn
if temprs.RecordCount <> 0 then
    do while not temprs.EOF
        if temprs.fields("country") = pubcountry then
            flag = true
            exit do
        end if
        temprs.MoveNext
    loop
end if

It goes into the loop in the above code.

And the code thats not working –

q = "select p_id from publisher where name='" & bookpub & "'"
prs.Open q, conn
pins = false
if prs.RecordCount > 0 then
    pid = prs.fields("p_id")
    pins = true
end if

Here, prs.RecordCount returns -1. All variables have been Dim-med in the earlier portion of the code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:05:03+00:00Added an answer on June 15, 2026 at 11:05 am

    Can I offer a different solution that gives you the same result but without using recordcount:

    q = "select p_id from publisher where name='" & bookpub & "'"
    prs.Open q, conn
    pins = false
    if not prs.eof then
        pid = prs("p_id")
        pins = true
    end if
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of old classic ASP pages, many of which show database
I have this classic ASP site which has been working fine until we updated
I have been working on a website using MVC Preview 1 since it came
I have been working on a system which I'm using protobuf-net (version 2.0.0.480) for
I've been working with an ASP Classic site with over 500 files, some of
We have a classic ASP application that simply works and we have been loathe
I'm working on a website with legacy Classic ASP pages (being converted to ASP.NET
I have taken on the task of converting a very old classic ASP/VBScript/Access web
Have been working on this question for a couple hours and have come close
I have been working with SQL Server as a Developer a while. One thing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.