Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

ASP viewing DB problem


  • Please log in to reply

#1
pinkrose

pinkrose

    New Member

  • Member
  • Pip
  • 1 posts
This code works for one web hosting but if i use this code to another web hosting it doesn't work. I didn't get any error for connect to DB but it won't display the result of DB.

The below source doesn't work with the hosting

<%
set Country_rs = server.createObject("ADODB.recordset")
mysql = "select * from Country where Country_Status = 1"
Country_rs.open mysql,con,1,3,1
if Country_rs.recordcount > 0 then
Do while not Country_rs.EOF
Country_ID = Country_rs.fields("Country_ID")
%>

But if i change to the source below it works

<%
set Country_rs = server.createObject("ADODB.recordset")
mysql = "select * from Country where Country_Status = 1"
Country_rs.open mysql,con,1,3,1
if Country_rs.EOF then

else
Do while not Country_rs.EOF
Country_ID = Country_rs.fields("Country_ID")
%>

What should I do to make it view results of DB without changing the code? I want to use the code using if Country_rs.recordcount > 0 then this to be able to display results of DB.

Thank you
  • 0

Advertisements







Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP