Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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