Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,038

HOME > ASP > ASP Forum > ทำแล้ว err ครับช่วยด้วย code asp ครับ ผมไม่สามารถเรียกไฟล์ dbconnect.asp


 

ทำแล้ว err ครับช่วยด้วย code asp ครับ ผมไม่สามารถเรียกไฟล์ dbconnect.asp

 
Topic : 007556

Guest



ผมไม่สามารถเรียกไฟล์ dbconnect.asp ได้


gPage= 1
gname=request.form ("1")
if gname="" then %> <a href="index.asp">&iexcl;&Aring;&Ntilde;&ordm;&Euml;&sup1;&eacute;&Ograve;&aacute;&Atilde;&iexcl;</a> <% else
serallchk=request.form ("search")


'Set Conn=Server.Createobject("ADODB.Connection")
'Conn.Open "jnm","sa",""

'<!--#include file="dbconnect.asp"-->
<!-- #include virtual="dbconnect.asp"-->
Set RS =Server.CreateObject("ADODB.Recordset")
if serallchk="name" then
gname=request.form ("1")
sql ="Select * from BcAr where name1 like '%"& gname &"%' ;"

else if serallchk="address" then
gname=request.form ("1")
sql ="Select * from BcAr where billAddress like '%"& gname &"%' ;"
else
gname=request.form ("1")
sql ="Select * from bcAr where code like'%"& gname &"%' or Name1 like'%"& gname &"%' or billAddress like'%"& gname &"%' ;"
end if
end if

rs.Open sql,conn,1, 3
TotalRow = rs.RecordCount
rs.PageSize = 20
IF TotalRow=0 THEN%>
<table align="center" border="0" width="50%" cellspacing="0">
<tr >
<td align="center" bgcolor=#33ccff><font color=#6633ff face="MS Sans Serif" size="1">&auml;&Aacute;&egrave;&frac34;&ordm;&cent;&eacute;&Iacute;&Aacute;&Ugrave;&Aring;&nbsp;&nbsp;&nbsp;</font></td>
<td align="center" bgcolor=#33ccff><font color=#ff33cc face="MS Sans Serif" size="1"><%=gname%></font></td>
<td align="center" bgcolor=#33ccff><font color=#6633ff face="MS Sans Serif" size="1">&nbsp;&nbsp;&nbsp;&iexcl;&Atilde;&Oslash;&sup3;&Ograve;&micro;&Atilde;&Ccedil;&uml;&Ecirc;&Iacute;&ordm;&atilde;&Euml;&Aacute;&egrave;</font>?</td>
<br>
</tr>
</table>
<center>
<a href="index.asp">&iexcl;&Aring;&Ntilde;&ordm;&Euml;&sup1;&eacute;&Ograve;&aacute;&Atilde;&iexcl;</a>
</center>
<%else
TotalPage = rs.PageCount
rs.Absolutepage =gPage
count=1
flag=1

%>
<table border="0" align="center" width="90%">
<tr bgcolor=#33ccff>
<td align="center" ><font face="MS Sans Serif" size="1">&Atilde;&Euml;&Ntilde;&Ecirc;&Aring;&Ugrave;&iexcl;&curren;&eacute;&Ograve;:</font></td>
<td align="center"><font face="MS Sans Serif" size="1">&ordf;&times;&egrave;&Iacute; - &sup1;&Ograve;&Aacute;&Ecirc;&iexcl;&Oslash;&Aring;:</font></td>
<td align="center"><font face="MS Sans Serif" size="1">&middot;&Otilde;&egrave;&Iacute;&Acirc;&Ugrave;&egrave;:</font></td>
<td align="center"><font face="MS Sans Serif" size="1">&acirc;&middot;&Atilde;&Egrave;&Ntilde;&frac34;&middot;&igrave;:</font></td>

</tr>
<%
Do while Not rs.EOF and count <= rs.PageSize

IF flag =1 THEN
flag = 0

%>
<tr >
<form action="buyproduct.asp" method="post">
<td align="left" valign="top" bgcolor="#CCFFFF">
<font color=#6633ff face="MS Sans Serif" size="1"><%= rs("code")%></font></td>
<td align="left" valign="top" bgcolor="#CCFFFF">
<font color=#6633ff face="MS Sans Serif" size="1"><a href="AR.asp?code=<%= rs("code")%>"><%= rs("name1") %></a></font></td>
<td align="left" valign="top" bgcolor="#CCFFFF">
<font color=#6633ff face="MS Sans Serif" size="1"><%= rs("billaddress") %>&nbsp;</font></td>
<td align="left" valign="top" bgcolor="#CCFFFF">
<font color=#6633ff face="MS Sans Serif" size="1"><%= rs("Telephone") %>&nbsp;</font></td>
</form>
</tr>
<%
Else
flag = 1
%>
<tr >
<form action="buyproduct.asp" method="post">
<td align="left" valign="top" bgcolor="#CCFFFF">

<font color=#6633ff face="MS Sans Serif" size="1"><%= rs("code")%></font></td>
<td align="left" valign="top" bgcolor="#CCFFFF">
<font color=#6633ff face="MS Sans Serif" size="1"><a href="AR.asp?code=<%= rs("code")%>"><%= rs("name1") %></a></font></td>
<td align="left" valign="top" bgcolor="#CCFFFF">
<font color=#6633ff face="MS Sans Serif" size="1"><%= rs("billaddress") %>&nbsp;</font></td>
<td align="left" valign="top" bgcolor="#CCFFFF">
<font color=#6633ff face="MS Sans Serif" size="1"><%= rs("Telephone") %>&nbsp;</font></td>
</form>
</tr>
<%end if

rs.MoveNext
count = count + 1
Loop
rs.close
conn.close
end if%>
</table>
<TABLE width=90% border=0 cellspacing=0 cellpadding=0 align="center">
<TR>
<TD COLSPAN=2 >
<table BORDER=0 cellspacing=0 cellpadding=0>
<tr>
<td height=4></td>
</tr>
</table>
</TD>
</TR>
<TR>
<TD COLSPAN=2>
<TABLE border=0 cellspacing=2cellpadding=2 >
<TR>
<TD> <FONT FACE="MS Sans Serif,CordiaUPC" Size ="1">&Euml;&sup1;&eacute;&Ograve; :</font></TD>
<%For pg = 1 to TotalPage %>
<TD BGCOLOR="#FFCC99"> <%IF pg=cint(cstr(gPage)) Then %> <blink><B><Font color = Red FACE="MS Sans Serif,CordiaUPC" Size ="1">
<%= pg%></font></B> </blink> <%Else%> <B><A HREF ='SearchAr2.asp?PageNo=<%= pg%>&gname=<%=gname%>'><FONT FACE="MS Sans Serif,CordiaUPC" Size ="1"><%=pg%></font></A></B>
<%End IF%> </TD>
<%Next
end if%> </TR>
</Table>
</Table>
</font>


Tag : - - - -

Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 11 มี.ค. 2549 01:29:23 By : kao View : 1990 Reply : 3
 

 

No. 1



โพสกระทู้ ( 422 )
บทความ ( 0 )



สถานะออฟไลน์





'Set Conn=Server.Createobject("ADODB.Connection")
'Conn.Open "jnm","sa",""

'<!--#include file="dbconnect.asp"-->
<!-- #include virtual="dbconnect.asp"--> ================== บรรทัดนี้ต้องเอาไว้ในส่วนที่ไม่ใช่ asp นะครับ ตัวอย่างเช่น
<!-- #include virtual="dbconnect.asp"-->
<%
asp statement
.
.
.
%>
ต้องเป็นแบบดังกล่าวนะครับถึงจะสามารถ Include ได้ เพราะว่าใน asp ไม่มีคำสั่งในการ Include file นะครับ
ที่ถูกน่าจะเป็นแบบนี้นะครับ

gPage= 1
gname=request.form ("1")
if gname="" then %> <a href="index.asp">&iexcl;&Aring;&Ntilde;&ordm;&Euml;&sup1;&eacute;&Ograve;&aacute;&Atilde;&iexcl;</a> <% else
serallchk=request.form ("search")


'Set Conn=Server.Createobject("ADODB.Connection")
'Conn.Open "jnm","sa",""

%>
<!-- #include virtual="dbconnect.asp"-->
<%

Set RS =Server.CreateObject("ADODB.Recordset")
if serallchk="name" then
gname=request.form ("1")
sql ="Select * from BcAr where name1 like '%"& gname &"%' ;"

else if serallchk="address" then
gname=request.form ("1")
sql ="Select * from BcAr where billAddress like '%"& gname &"%' ;"
else
gname=request.form ("1")
sql ="Select * from bcAr where code like'%"& gname &"%' or Name1 like'%"& gname &"%' or billAddress like'%"& gname &"%' ;"
end if
end if

rs.Open sql,conn,1, 3
TotalRow = rs.RecordCount
rs.PageSize = 20
IF TotalRow=0 THEN%>
<table align="center" border="0" width="50%" cellspacing="0">
<tr >
<td align="center" bgcolor=#33ccff><font color=#6633ff face="MS Sans Serif" size="1">&auml;&Aacute;&egrave;&frac34;&ordm;&cent;&eacute;&Iacute;&Aacute;&Ugrave;&Aring;&nbsp;&nbsp;&nbsp;</font></td>
<td align="center" bgcolor=#33ccff><font color=#ff33cc face="MS Sans Serif" size="1"><%=gname%></font></td>
<td align="center" bgcolor=#33ccff><font color=#6633ff face="MS Sans Serif" size="1">&nbsp;&nbsp;&nbsp;&iexcl;&Atilde;&Oslash;&sup3;&Ograve;&micro;&Atilde;&Ccedil;&uml;&Ecirc;&Iacute;&ordm;&atilde;&Euml;&Aacute;&egrave;</font>?</td>
<br>
</tr>
</table>
<center>
<a href="index.asp">&iexcl;&Aring;&Ntilde;&ordm;&Euml;&sup1;&eacute;&Ograve;&aacute;&Atilde;&iexcl;</a>
</center>
<%else
TotalPage = rs.PageCount
rs.Absolutepage =gPage
count=1
flag=1

%>
<table border="0" align="center" width="90%">
<tr bgcolor=#33ccff>
<td align="center" ><font face="MS Sans Serif" size="1">&Atilde;&Euml;&Ntilde;&Ecirc;&Aring;&Ugrave;&iexcl;&curren;&eacute;&Ograve;:</font></td>
<td align="center"><font face="MS Sans Serif" size="1">&ordf;&times;&egrave;&Iacute; - &sup1;&Ograve;&Aacute;&Ecirc;&iexcl;&Oslash;&Aring;:</font></td>
<td align="center"><font face="MS Sans Serif" size="1">&middot;&Otilde;&egrave;&Iacute;&Acirc;&Ugrave;&egrave;:</font></td>
<td align="center"><font face="MS Sans Serif" size="1">&acirc;&middot;&Atilde;&Egrave;&Ntilde;&frac34;&middot;&igrave;:</font></td>

</tr>
<%
Do while Not rs.EOF and count <= rs.PageSize

IF flag =1 THEN
flag = 0

%>
<tr >
<form action="buyproduct.asp" method="post">
<td align="left" valign="top" bgcolor="#CCFFFF">
<font color=#6633ff face="MS Sans Serif" size="1"><%= rs("code")%></font></td>
<td align="left" valign="top" bgcolor="#CCFFFF">
<font color=#6633ff face="MS Sans Serif" size="1"><a href="AR.asp?code=<%= rs("code")%>"><%= rs("name1") %></a></font></td>
<td align="left" valign="top" bgcolor="#CCFFFF">
<font color=#6633ff face="MS Sans Serif" size="1"><%= rs("billaddress") %>&nbsp;</font></td>
<td align="left" valign="top" bgcolor="#CCFFFF">
<font color=#6633ff face="MS Sans Serif" size="1"><%= rs("Telephone") %>&nbsp;</font></td>
</form>
</tr>
<%
Else
flag = 1
%>
<tr >
<form action="buyproduct.asp" method="post">
<td align="left" valign="top" bgcolor="#CCFFFF">

<font color=#6633ff face="MS Sans Serif" size="1"><%= rs("code")%></font></td>
<td align="left" valign="top" bgcolor="#CCFFFF">
<font color=#6633ff face="MS Sans Serif" size="1"><a href="AR.asp?code=<%= rs("code")%>"><%= rs("name1") %></a></font></td>
<td align="left" valign="top" bgcolor="#CCFFFF">
<font color=#6633ff face="MS Sans Serif" size="1"><%= rs("billaddress") %>&nbsp;</font></td>
<td align="left" valign="top" bgcolor="#CCFFFF">
<font color=#6633ff face="MS Sans Serif" size="1"><%= rs("Telephone") %>&nbsp;</font></td>
</form>
</tr>
<%end if

rs.MoveNext
count = count + 1
Loop
rs.close
conn.close
end if%>
</table>
<TABLE width=90% border=0 cellspacing=0 cellpadding=0 align="center">
<TR>
<TD COLSPAN=2 >
<table BORDER=0 cellspacing=0 cellpadding=0>
<tr>
<td height=4></td>
</tr>
</table>
</TD>
</TR>
<TR>
<TD COLSPAN=2>
<TABLE border=0 cellspacing=2cellpadding=2 >
<TR>
<TD> <FONT FACE="MS Sans Serif,CordiaUPC" Size ="1">&Euml;&sup1;&eacute;&Ograve; :</font></TD>
<%For pg = 1 to TotalPage %>
<TD BGCOLOR="#FFCC99"> <%IF pg=cint(cstr(gPage)) Then %> <blink><B><Font color = Red FACE="MS Sans Serif,CordiaUPC" Size ="1">
<%= pg%></font></B> </blink> <%Else%> <B><A HREF ='SearchAr2.asp?PageNo=<%= pg%>&gname=<%=gname%>'><FONT FACE="MS Sans Serif,CordiaUPC" Size ="1"><%=pg%></font></A></B>
<%End IF%> </TD>
<%Next
end if%> </TR>
</Table>
</Table>
</font>

เห่อ ๆ ปามาณนี้แหละมั้ง ลองดูนะ
Date : 11 มี.ค. 2549 07:59:20 By : นายกระจอก
 

 

No. 2

Guest


ขอบคุณครับ ผมทำได้แล้วครับ
Date : 11 มี.ค. 2549 21:48:47 By : kao
 

 

No. 3

Guest


CD 30 เพื่อศึกษาและวิจัย เกม ซอฟร์แวร์ แผ่นสอน และอื่น ๆ อีกมากมายเชิญชมที่ http://www.cookies.such.info
Date : 20 มี.ค. 2549 03:09:09 By : dos
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ทำแล้ว err ครับช่วยด้วย code asp ครับ ผมไม่สามารถเรียกไฟล์ dbconnect.asp
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)





ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2025 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่