hassan1365
پنج شنبه 17 شهریور 1384, 11:32 صبح
سلام
وقتی تو یه textarea محتویات بانک رو میذارم خراب نمایش میده ولی در حالت عادی درسته.
این کدشه:
<%@Language=VBScript CodePage = 65001%>
<html>
<head>
<title>My First ASP Page</title>
</head>
<body bgcolor="white" text="black">
<h1>Show Data in textarea</h1>
<center><textarea style="background:url('../images/back1.gif')" rows="10" cols="65" dir="ltr">
<%
Dim adoCon
Dim rsGuestbook
Dim strSQL
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("tel.mdb")
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblComments.title, tblComments.Comments FROM tblComments;"
rsGuestbook.Open strSQL, adoCon
Do While not rsGuestbook.EOF
Response.Write ("<br>")
Response.Write (rsGuestbook("title"))
Response.Write ("<br>")
Response.Write (rsGuestbook("Comments"))
Response.Write ("<br>")
rsGuestbook.MoveNext
Loop
rsGuestbook.Close
Set rsGuestbook = Nothing
Set adoCon = Nothing
%>
</textarea></center>
<br>
<h1>Show Data out of textarea</h1>
<%
Dim adoCon1
Dim rsGuestbook1
Dim strSQL1
Set adoCon1 = Server.CreateObject("ADODB.Connection")
adoCon1.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("tel.mdb")
Set rsGuestbook1 = Server.CreateObject("ADODB.Recordset")
strSQL1 = "SELECT tblComments.title, tblComments.Comments FROM tblComments;"
rsGuestbook1.Open strSQL, adoCon1
Do While not rsGuestbook1.EOF
Response.Write ("<br>")
Response.Write (rsGuestbook1("title"))
Response.Write ("<br>")
Response.Write (rsGuestbook1("Comments"))
Response.Write ("<br>")
rsGuestbook1.MoveNext
Loop
rsGuestbook1.Close
Set rsGuestbook1 = Nothing
Set adoCon1 = Nothing
%>
</body>
</html>
نظر دوستان چیه؟
موفق باشید.
وقتی تو یه textarea محتویات بانک رو میذارم خراب نمایش میده ولی در حالت عادی درسته.
این کدشه:
<%@Language=VBScript CodePage = 65001%>
<html>
<head>
<title>My First ASP Page</title>
</head>
<body bgcolor="white" text="black">
<h1>Show Data in textarea</h1>
<center><textarea style="background:url('../images/back1.gif')" rows="10" cols="65" dir="ltr">
<%
Dim adoCon
Dim rsGuestbook
Dim strSQL
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("tel.mdb")
Set rsGuestbook = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblComments.title, tblComments.Comments FROM tblComments;"
rsGuestbook.Open strSQL, adoCon
Do While not rsGuestbook.EOF
Response.Write ("<br>")
Response.Write (rsGuestbook("title"))
Response.Write ("<br>")
Response.Write (rsGuestbook("Comments"))
Response.Write ("<br>")
rsGuestbook.MoveNext
Loop
rsGuestbook.Close
Set rsGuestbook = Nothing
Set adoCon = Nothing
%>
</textarea></center>
<br>
<h1>Show Data out of textarea</h1>
<%
Dim adoCon1
Dim rsGuestbook1
Dim strSQL1
Set adoCon1 = Server.CreateObject("ADODB.Connection")
adoCon1.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("tel.mdb")
Set rsGuestbook1 = Server.CreateObject("ADODB.Recordset")
strSQL1 = "SELECT tblComments.title, tblComments.Comments FROM tblComments;"
rsGuestbook1.Open strSQL, adoCon1
Do While not rsGuestbook1.EOF
Response.Write ("<br>")
Response.Write (rsGuestbook1("title"))
Response.Write ("<br>")
Response.Write (rsGuestbook1("Comments"))
Response.Write ("<br>")
rsGuestbook1.MoveNext
Loop
rsGuestbook1.Close
Set rsGuestbook1 = Nothing
Set adoCon1 = Nothing
%>
</body>
</html>
نظر دوستان چیه؟
موفق باشید.