sp DB update 질문입니다.
글쓴이: ka1963 / 작성시간: 일, 2013/12/22 - 7:51오전
ASP 에서 DB UPDATE 하려하는데 요류가서 올립니다.
우선 코드 올릴테니 짤은거니 좀 보고 오류좀 찾아주세요.
밑에 코드에서 room = Request.Form("s_d") 이부분은 그전에 입력 받은것인데 TABLE 이름이면서 변수입니다.
[room.asp]
<head> <% set Conn = Server.CreateObject("ADODB.Connection") Conn.Open ("DSN=movie") room = Request.Form("s_d") SQLString = "Select b_seat,b_reservation From "& room & " order by b_seat" Set Result = Conn.Execute(SQLString) %> </head> <body bgcolor="white"> <center> <font size="6"><%=room%> 좌석 현황 </font> <br> <br> <table width="*" cellpadding="5"> <tr bgcolor="royalblue" align="center" height="10"> <font color="white"> <td width="70"> <font color="white">좌석번호 </td> <td width="100"> <font color="white">예약현황 </td> </font> </tr> <% Do while Not Result.EOF %> <tr height="14"> <td align="center"> <%=Result("b_seat")%> </td> <td align="center"> <%=Result("b_reservation")%> </td> </tr> <% Result.MoveNext Loop %> </table> <br> <form action="update.asp" method="post"> 좌석번호 : <input type="text" name="s_S" size="10"> <input type="submit" value="예약"> </form> </center> </body>
<%
Result.Close
Set Result = Nothing
Conn.Close
Set Conn = Nothing
%>
[update.asp]
<%
room = Request("room")
id = Request("memberid")
seat = Request.Form("s_S")
set Dbcon = Server.CreateObject("ADODB.Connection")
Dbcon.Open ("DSN=movie")
sql="Update "&room&" SET b_ID = '" &id&"', b_reservation = 'OCCUPIED' where b_seat= "& seat
Dbcon.Execute(sql)
url = "home.asp"
Dbcon.close
set Dbcon = Nothing
Response.Redirect url
%>
이렇게 코드짜고 위 그림 에서 빈좌석의 번호를 누르면 아래와 같은 오류가 떠요....
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] FROM 절의 구문 오류입니다.
/room.asp, line 11
File attachments:
첨부 | 파일 크기 |
---|---|
room.jpg | 1.3 MB |
Forums:
댓글 달기