Link to home
Start Free TrialLog in
Avatar of Wayne Barron
Wayne BarronFlag for United States of America

asked on

ASP Classic connection string (Database name change) messes up javascript

Yep, you read the title right.

OK, I have done a LOT of updates to the site, and to the database.
I downloaded the LIVE database from "Hosting"

#1: Restores the database with a different name.
#2: Edited the tables, added in new tables.
#3: Added the Database name into the connection string.
Set Conn = CreateObject("ADODB.Connection")
Conn.ConnectionString = "Provider=SQLOLEDB;Data Source=server\instance;Database=UPDATED-DB;User ID=username;Password=password;"
Conn.Open

Open in new window


This is the javascript that is (with the new database connection) not working.

<script>
function showdiv(name){ 
var obj = (document.getElementById)? document.getElementById(name) : eval("document.all[name]"); 
if (obj.style.display=="none"){ 
obj.style.display="block"; 
}else{ 
obj.style.display="none"; 
} 
} 
</script>
<a href='#tab4' onClick="$('#tab4').load('file.asp?proid=<%=proID%>');showdiv('tab4');showdiv('paginationFB');" data-state="none">Followed By</a>

Open in new window


OK, this work: showdiv('tab4');
This does not work.: showdiv('paginationFB');

Now, if I changed the database name to the original name,
Set Conn = CreateObject("ADODB.Connection")
Conn.ConnectionString = "Provider=SQLOLEDB;Data Source=server\instance;Database=ORIGINAL-DB;User ID=username;Password=password;"
Conn.Open

Open in new window

Then everything works the way it supposed to work.

I viewed the source code, and everything is there, everything matches between the two database name changes.
Is it just that with the Updated-DB, the 2nd showdiv, will not fire.
But, as I stated, if I change it back to the original-db, then it will fire, and everything works as planned.

Any idea's on what I can check?
I have done through both DB's and I cannot see anything that is out-of-place.
I have looked at the code, I have changed things around, and still.
Will only work with the original-db, and not with the updated-db

Thanks for any and all assistance in this annoying issue.
Carrzkiss
SOLUTION
Avatar of jitendra patil
jitendra patil
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is the javascript that is (with the new database connection) not working.

js and new db??? not related at all
save the rendered page with old/new db and compare
or post here (attach) so we can check...
Avatar of Wayne Barron

ASKER

@jitendra
There are no references in the DB for the "paginationFB"
This is on the page itself.
It is called from the link when clicked.

@Huseyin
have already checked the rendered page. as stated in my OP
>> I viewed the source code, and everything is there, everything matches between the two database name changes.
Thre is NO difference in the two pages, what-so-ever.
Every line is identical.

As stated.
Once I add in the original -db, it works.
With new db, does not work.
I mean, the entire site works with the new-db connected.
Just not in this one area.
When it needs to show the pagination (paging controls). (Of which, you helped me on the SQL code with)
It does not work, with the new DB.

(Everything is identical)

I have:
Closed out of all Google Chrome, and EDGE browsers.
Restarted IIS
Rebooted the computer

And still, does not work with the new db.
I am not asking source code...

I am talking about the result in browser, rendered html, response :)

by looking at response differences, we can identify db issues...
what is the result of this

<a href='#tab4' onClick="$('#tab4').load('file.asp?proid=<%=proID%>');showdiv('tab4');showdiv('paginationFB');" data-state="none">Followed By</a>

in new db
<a href='#tab4' onClick="$('#tab4').load('file.asp?proid=1');showdiv('tab4');showdiv('paginationFB');" data-state="none">Followed By</a>

Both DB's have the same identical information. (proid is the UserID)
I have checked the SQL Code against both DB's, and they give near about identical results.
Except the new DB has the information from the LIVE site.
Compared to the information from the development site.

>>I am talking about the result in browser, rendered html, response :)
That is what I was talking about. (Source Code = rendered HTML)
I have already compared them side-by-side
They are Identical.
This is what this part looks like.
This is identical in both new and old DB.
<a href='#tab4' onClick="$('#tab4').load('file.asp?proid=1');showdiv('tab4');showdiv('paginationFB');" data-state="none">Followed By</a>

<div id="tab4" style="margin-top:auto;"></div>
<div style="display:none;" class="paginationFB pagination" id="paginationFB"></div>

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Reassign points
Thanks Wayne.
Absolutely, jitendra.
I have reassigned points. giving Jitendra points as well.
Though the database did not hold information for the tabs,
He was on the right path, as there was an issue with the database.
And that was, the LIVE database did not have the same records for the tested user.

F12 is what showed me the problem line, of which I found, and then Huseyin posted about it as well.

Thanks, to the both of you.
Wayne