出来るのだASP Q&A掲示板(過去LOG)
訪問数 52046
昨日 889
今日 776 【PR】 パソコン入門からIT専門書まで幅広く取り揃えています。セブン-イレブン受取り手数料無料のセブンアンドワイ。 |
![]() ![]() ![]() ![]() ![]() |
[3191] ODBC接続が不安定? |
投稿者:こゆきさん 2003/02/12 14:32:31 |
はじめて投稿します。 先週からASP初心者でわからなくて困っております。 ご存知の方がおりましたらご教授ください。 ログイン画面からIDとパスワードを引き渡してますが、 ログインできたりできなかったりと、不安定なんです。 例えば、1回目はログインできるけど、2回目は出来なかったり。 問題となる個所や原因が想定できる方がおりましたら、教えてください! <%@ LANGUAGE="VBScript" %> <% If Session("LoginPASS") = "" Then Session("LoginPASS") = Request.Form("LoginPASS") End If Session("user")=Request.Form("User") Session("passwd")=Request.Form("Passwd") %> <html> <head> <meta http-equiv="Content-Language" content="ja"> <meta http-equiv="Content-Type" content="text/html; charset=shift_jis"> <title>メニュー</title> </head> <body bgcolor="#ffffff"> <div align="center"> <table BGCOLOR="#0023a5" border="1" cellpadding="15" width=100% height="15"> <tr> <td nowrap height="15" ><center><font size="5" color="#ffffff">メニュー</font></center></td> </tr> </table> </div> <hr> <% On Error Resume Next If Session("Passwd") <> "" and Session("User") <> "" Then Set DBconnect = Server.CreateObject("ADODB.Connection") DBConnect.Open "NMICS_DB" SQLs = "select * from M_User where " & _ "UserName = '" & Session("User") & "' and " &_ "PASSWD = '" & Session("Passwd") & "';" Set RS = Server.CreateObject("ADODB.Recordset") RS.Open SQLs,DBConnect,3,2 Session("LoginPASS") = "0" '初期化 If Not (RS.EOF Or RS.BOF) Then Session("start") = Now Session("LoginPASS") = "1" 'セキュリティ用に1をセット If Err.number <> 0 Then 'エラー発生 Response.Write("<font size='6'>はずれ1</font>") Response.Write("<center><INPUT type='image' src=images/back.gif border=0 onclick=history.back() id=button1 name=button1 STYLE='font-size: 14pt'></center>") Response.End End If Else Response.Write("<p align='left'><font size='6'>はずれ2</font></P>") Response.Write("<center><INPUT type='image' src=images/back.gif border=0 onclick=history.back() id=button1 name=button1 STYLE='font-size: 14pt'></center>") set DBConnect=Nothing Response.End End If RS.close set RS=nothing 'set DBConnect=nothing else Response.write("はずれ4") Response.End End If If Session("LoginPASS") = "" Then Response.Write("はずれ3") Response.End End If %> 以下省略 |
![]() ![]() |
![]() |
TreeBBS For ASP V.0.1.3 |