مطمئنم که کد نيميتونه کاري بکنه شما بايد به سوال من خوب توجه کنيد من ميخوام با تغيير در کامبوباکس همزمان با تغيير در کامبو باکس يکسري اطلاعات از ديتابيس خوانده شوند و در بقيه فيلدها نوشته بشن؟
<%
Option Explicit
if Session("LoggedIn") <> "yes" then
Session("Message") = "نام کاربري و رمز عبور را وارد کنيد در صورت صحيح بودن وارد سيستم مي شويد."
Response.Redirect "login.asp"
end if
Sub DrawPage()
%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<BASE TARGET="_parent">
<LINK REL=STYLESHEET TYPE="text/css" HREF="./style.css">
<STYLE>
</STYLE>
<script LANGUAGE="VBSCRIPT">
Sub Canc()
self.location.href="./start.asp"
end sub
</script>
</HEAD>
<BODY BGCOLOR="#003366" dir=rtl>
<form NAME=frmMotagazi action="motagazi.asp" target=mainFrame method="post">
<Font face="tahoma">
<table border=0 cellspacing=0 cellpadding=0 width="100%" height="47">
<TR>
<TD HEIGHT=67 Colspan=10>
<center>
<font face = "Tahoma" color="#AF00ff" size = 5>
<b>تقاضاي رهن و اجاره</b>
</font>
</center>
</TD>
</TR>
<tr>
<td width="12%" height="36">
<FONT COLOR="Lime"> کد متقاضي : </font>
</td>
<td width="19%" height="36">
<input type="text" name="txtMCode" value="<%
Dim MCode
Dim DB
Set DB = Server.CreateObject("ADODB.Connection")
DB.Open ("Provider=SQLOLEDB;Data Source=(local);Initial Catalog=Amlak;User ID=SA;Password=;")
MCode = 111000
Dim RS
Set RS = Server.CreateObject ("ADODB.Recordset")
RS.Open "SELECT COUNT(*) FROM Motagazi", DB
MCode = MCode + rs.Fields(0)
Rs.Close
RS.Open "SELECT COUNT(*) FROM Garardad", DB
MCode = MCode + rs.Fields(0)
response.write MCode
%>" maxlength="10" SIZE=10>
</td>
<td width="14%" colspan=2 height="36">
<FONT COLOR="Lime"> کد سپرده : </font>
</td>
<td width="23%" colspan=3 height="36">
<%
Set DB = Server.CreateObject("ADODB.Connection")
DB.Open ("Provider=SQLOLEDB;Data Source=(local);Initial Catalog=Amlak;User ID=SA;Password=;")
Set RS = Server.CreateObject ("ADODB.Recordset")
RS.Open "SELECT SCode FROM Sepordeh WHERE SType = 'رهن و اجاره' AND Wm IS NULL", DB
If NOT (RS.EOF And RS.BOF) Then
RS.MoveFirst
Response.Write "<select name=""txtSCode"" value="
Response.Write RS.Fields(0)
Response.Write ">"
While Not RS.EOF
Response.Write "<option value="
Response.Write RS.Fields(0)
Response.Write ">"
Response.Write RS.Fields(0)
Response.Write " & nbsp; &nb sp; "
Response.Write"</option>"
RS.MoveNext
Wend
Else
Response.Write "<select name=""txtSCode"" value="""" "">"
Response.Write "<option value=""""></option>"
End If
%>
<INPUT TYPE="BUTTON" NAME=add VALUE="...">
</td>
<td width="10%" colspan=2 height="36">
<FONT COLOR="Lime"> نوع ملک : </font>
</td>
<td width="20%" height="36">
<input type="text" name="txtTMelk" value="" maxlength="10">
</td>
</tr>
<tr>
<td width="13%" height="36">
<FONT COLOR="Lime"> کاربري : </font>
</td>
<td width="22%" colspan=2 height="36">
<input type="text" name="txtKarbari" value="" maxlength="10">
</td>
<td width="25%" colspan=4 height="36">
<FONT COLOR="Lime"> نام و نام خانوادگي متقاضي : </font>
</td>
<td width="38%" colspan=3 height="36">
<input type="text" name="txtNFMotagazi" maxlength="50" SIZE=32>
</td>
</tr>
<tr>
<td width="13%" height="36">
<FONT COLOR="Lime"> آدرس : </font>
</td>
<td width="56%" colspan=5 height="36">
<input type="text" name="txtAddress" maxlength="100" SIZE=60>
</td>
<td width="7%" colspan=2 height="36">
<FONT COLOR="Lime"> تلفن : </font>
</td>
<td width="24%" colspan=2 height="36">
<input type="text" name="txtTelephone" value="" maxlength="11" SIZE=26>
</td>
</tr>
<tr>
<td width="100%" colspan=10 height="36">
</td>
</tr>
<tr>
<td width="100%" colspan=10 height="50">
<center>
<input type="submit" name="cmdSave" value="ذخيره اطلاعات">
<input type="button" name="cmdCancel" value="صرف نظر" onclick="Canc()">
</center>
</td>
</tr>
</table>
</font>
</form>
<SCRIPT LANGUAGE=VBSCRIPT>
Sub add_Onclick()
Set EN = DOCUMENT.frmMotagazi
EN.txtTMelk.VALUE = "<%
Set DB = Server.CreateObject("ADODB.Connection")
DB.Open ("Provider=SQLOLEDB;Data Source=(local);Initial Catalog=Amlak;User ID=SA;Password=;")
Set RS = Server.CreateObject ("ADODB.Recordset")
RS.Open "SELECT Vazeiat FROM Sepordeh WHERE SCode='"& request("txtSCode")&"'", DB
If NOT (RS.EOF And RS.BOF) Then
RS.MoveFirst
dim x
x = RS.Fields(0)
Response.Write (x)
END IF
%>"
EN.txtKarbari.VALUE ="<%
Set DB = Server.CreateObject("ADODB.Connection")
DB.Open ("Provider=SQLOLEDB;Data Source=(local);Initial Catalog=Amlak;User ID=SA;Password=;")
Set RS = Server.CreateObject ("ADODB.Recordset")
RS.Open "SELECT Karbari FROM Sepordeh WHERE SCode='"& request("txtSCode")&"'", DB
If NOT (RS.EOF And RS.BOF) Then
RS.MoveFirst
x = RS.Fields(0)
Response.Write (x)
END IF
%>"
end sub
</script>
</body>
</html>
<%
End Sub
Call DrawPage()
%>