Arama butonu
Bu konudaki kullanıcılar: 1 misafir
4
Cevap
1397
Tıklama
0
Öne Çıkarma
ADODB.Recordset error '800a0e7d' hatası..?
E
10 yıl
Teğmen
Konu Sahibi

Arkadaşlar bugün Access veri tabanı ile çalışan web sitemi sql veri tabanına çevirdim.
Anasayfada üye girişine tıklayınca aşağıdaki gibi bir hata alıyorum. Yardımlarınızı bekliyorum..

ADODB.Recordset error '800a0e7d'

The connection cannot be used to perform this operation. It is either closed or invalid in this context.

/login.asp, line 76


76.satırda yazan kod
rsCheckUser.Open strSQL, adoCon

DH forumlarında vakit geçirmekten keyif alıyor gibisin ancak giriş yapmadığını görüyoruz.

Üye olduğunda özel mesaj gönderebilir, beğendiğin konuları favorilerine ekleyip takibe alabilir ve daha önce gezdiğin konulara hızlıca erişebilirsin.

Üye Ol Şimdi Değil



L
10 yıl
Yüzbaşı

bağlantı kodlarını tam olarak yazar mısınız?
bu hata genelde aynı bağlantı değişkenlerini içiçe kullanmaktan kaynaklanır veya kapatılmış bir bağlantı tekrar kapatıldığında yaşanır


Bu mesaja 1 cevap geldi.
E
10 yıl
Teğmen
Konu Sahibi

yukarıdaki hatayı aldığım giriş.asp dosyamın kodları aşağıdaki gibi...
hata veren satırı kalın harflerle işaretledim..

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>

<form method="POST" action="uye_girdi.asp" target="_top">

<table width="500" border="0" align="center" cellpadding="0" cellspacing="0" >
<tr>
<td style="border:1px solid #242424;"><table width="500" border="0" align="center" cellpadding="3" cellspacing="3">
<tr>
<td height="25" colspan="2" style="background-image:url(images/ustmenubg2.jpg)" cellpadding="0" cellspacing="0" ><div align="center" class="style1">..:: YÖNETİCİ GİRİŞİ::.. </div></td>
</tr>
<tr>
<td align="center" valign="top"><p><img src="images/family-icon.png" width="400" height="128" /></p>
<p> </p></td>
</tr>

<tr>
<td height="25" cellpadding="0" cellspacing="0" align="center" >
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsCheckUser 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query to query the database
Dim strUserName 'Holds the user name
dim passx, rsUye

'Initalise the strUserName variable
strUserName = Request.Form("txtUserName")

'Create an ADO connection object
Set adoCon = Server.CreateObject("ADODB.Connection")

'Set an active connection to the Connection object using a DSN-less connection
mysql_server = "******"
mysql_user = "********"
mysql_pass = "*******"
mysql_db = "*********"

Set condb = Server.createObject("Adodb.Connection")
condb.Open "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=" & mysql_server & "; UID=" & mysql_user & "; pwd=" & mysql_pass & "; db=" & mysql_db & ";"


'Set an active connection to the Connection object using DSN connection
'adoCon.Open "DSN=guestbook"

'Create an ADO recordset object
Set rsCheckUser = Server.CreateObject("ADODB.Recordset")

'Initialise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT password, ID, username FROM tblUsers WHERE username ='" & strUserName & "'"

'Open the recordset with the SQL query
rsCheckUser.Open strSQL, adoCon

session("member")=""
txtUserName=request.form("txtUserName")
if txtUserName="" or txtUserName=" " then
response.Write("<img src='images/hata.gif' /><br><br>Kullanıcı Adınızı Yazmadınız..!<br><br>")
response.Write("<img src='images/ok.gif' /> <a href=JavaScript:history.go(-1)>Geri dönün ve gerekli verileri doldurun</a><br><br><br><br>")
else

txtUserPass=request.form("txtUserPass")
if txtUserPass="" or txtUserPass=" " then
response.Write("<img src='images/hata.gif' /><br><br>Parola Yazmadınız..!<br><br>")
response.Write("<img src='images/ok.gif' /> <a href=JavaScript:history.go(-1)>Geri dönün ve gerekli verileri doldurun</a><br><br><br><br>")
else

strSQL = "SELECT * FROM tblusers WHERE username LIKE '" & txtUserName &"'"
'& " and UYE_PAROLA=" & passx & ""
set rsUye = server.CreateObject("adodb.recordset")
rsUye.Open strSQL, my_Conn
if rsUye.BOF or rsUye.EOF then
response.Write("<img src='images/hata.gif'/><br><br>Böyle Bir Kullanıcı Yok..!<br><br>")
response.Write("<img src='images/ok.gif' /> <a href=JavaScript:history.go(-1)>Geri dönün ve gerekli verileri doldurun</a><br><br><br><br>")
else

IF not txtUserPass = password THEN
response.Write("<img src='images/hata.gif'/><br><br>Şifrenizi Hatalı Girdiniz..!<br><br>")
response.Write("<img src='images/ok.gif' /> <a href=JavaScript:history.go(-1)>Geri dönün ve gerekli verileri doldurun.</a><br><br><br><br>")
end if
end if
end if
end if
'If the recordset finds a record for the username entered then read in the password for the user
If NOT rsCheckUser.EOF Then

'Read in the password for the user from the database
If (Request.Form("txtUserPass")) = rsCheckUser("password") Then

'Write the HTML to display the current record in the recordset

Session("userGood") = True
Session("userID") = rsCheckUser("ID")
Session("userName") = rsCheckUser("username")
Session("seviye")= seviye


'Reset server objects
rsCheckUser.Close
Set rsCheckUser = Nothing
Set adoCon = Nothing

'Redirect to the authorised user page and send the users name
Response.Redirect"anasayfa.asp"

End If
End If

'Reset server objects
rsCheckUser.Close
Set rsCheckUser = Nothing
Set adoCon = Nothing

'If the script is still running then the user must not be authorised
Session("userGood") = False

'Redirect to the unautorised user page

%>


</td>
</tr>
<tr>
<td height="25" cellpadding="0" cellspacing="0" style="background-image:url(images/ustmenubg2.jpg)" > </td>
</tr>
</table></td>
</tr>
</table>

</form>
</body>
</html>





< Bu mesaj bu kişi tarafından değiştirildi edihav -- 11 Şubat 2015; 14:46:01 >
Bu mesaja 1 cevap geldi.
L
10 yıl
Yüzbaşı

strUserName değerinin gelip gelmediğini kontrol edin geliyorsa veritabanında o değere dair kayıt olup olmadığını kontrol edin


Bu mesaja 1 cevap geldi.
T
10 yıl
Teğmen

Henüz açılmamış bir bağlantı (connection) kullanarak sorgu yapıyorsun.

Aslında bağlantı olarak adoCon değil, condb'yi kullanıyorsun.
"rsCheckUser.Open strSQL, condb" dener misin?



DH Mobil uygulaması ile devam edin. Mobil tarayıcınız ile mümkün olanların yanı sıra, birçok yeni ve faydalı özelliğe erişin. Gizle ve güncelleme çıkana kadar tekrar gösterme.