Author |
Topic |
|
getwidth
Starting Member
15 Posts |
Posted - 17 April 2002 : 09:13:18
|
Hello everyone, I appreciate all the comments to this post and your support. Here is my code:
<% dim RS Set RS = Server.CreateObject("ADODB.Recordset") RS.Open "mail_List", Conn, 2, 2
RS.Find "ID='" & Request.Form("Member") & "'"
RS("Email") = request("Email") RS("handle") = request("handle") RS("Name_Last") = request("Name_Last") RS("Name_First") = request("Name_First") RS("city") = request("city") RS("state") = request("state") If NOT (request("Date_In") = "") Then RS("Date_In") = request("Date_In") End If
RS.update %>
Here is the error: Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'find'
/mail/subscribers_edit2.asp, line 8
Line 8 is where it said rs.find as you can gather. Does anyone know why this is happening? Is this happening becuase I have mysql vs. access and/or is there another way around this error. Thank You Billy
This doesn't have anything to do with Snitz Forums. Moved from Help:Database:Mysql - Davio
Edited by - Davio on 17 April 2002 11:30:15 |
|
Doug G
Support Moderator
USA
6493 Posts |
Posted - 17 April 2002 : 09:45:42
|
I don't use MySQL, but you usually need to position the cursor in your recordset before issuing a find. Try putting a rs.movefirst before the find.
====== Doug G ====== |
|
|
getwidth
Starting Member
15 Posts |
Posted - 17 April 2002 : 10:23:24
|
Thank You for your response. I tried putting the rs.movefirst before the rs.find and still got the error. So no go still :-(
|
|
|
Davio
Development Team Member
Jamaica
12217 Posts |
Posted - 17 April 2002 : 11:32:13
|
I have never heard of a Find method in a recordset. And it seems your recordset comes to the same conclusion as mine.
«------------------------------------------------------» Want to know when the next version comes out, as soon as possible? Join our Mailing Lists ! |
|
|
getwidth
Starting Member
15 Posts |
Posted - 17 April 2002 : 12:12:38
|
If i comment the rs.find out and run the page and update the contact, it messes it up. It puts this feild here in this record and this on in this record. It doesn't update right. So I was guessing that I need the rs.find in there. It was originally design for access and i made it on mysql. I searched but I didn't find any links on how to update records and such. Does anyone have some links or something? I'm guessing I can do without the rs.find and code it another way. Thank You Billy
|
|
|
Doug G
Support Moderator
USA
6493 Posts |
Posted - 17 April 2002 : 22:55:44
|
quote:
I have never heard of a Find method in a recordset. And it seems your recordset comes to the same conclusion as mine.
«------------------------------------------------------» Want to know when the next version comes out, as soon as possible? Join our Mailing Lists !
Find is a method of ado recordsets.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdobjodbrecpme.asp
If you can't perform a find with MySQL perhaps the MyODBC doesn't provide the method. Also, I think I saw somewhere that you need a navigable recordset for find to work (i.e., not a forward-only cursor).
Try RS.CursorLocation = 3 RS.Open "mail_List", Conn, 3, 3
as a couple alternatives. The rs.cursorlocation = 3 will open the cursor as a client-side cursor. The 3's in the open statement will open a static cursor with optimistic locking.
====== Doug G ======
Edited by - Doug G on 17 April 2002 22:59:04 |
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 18 April 2002 : 09:12:56
|
Doug's solution will probably solve the issue for you.
Another option, since you seem to be looking for a specific record, would be to do that directly with an SQL instruction when you open the recordset. It will be a lot faster than opening the recordset, get all the records and then have the slow Find method to look for the record you want. Why not opening the recordset immediately with the record you want?
------------------------------------------------- Installation Guide | Do's and Dont's | MODs |
|
|
getwidth
Starting Member
15 Posts |
Posted - 18 April 2002 : 09:13:24
|
Thank you Doug. I tried that code and still got the error. I also should say that this is linux with chilisoft on it. I tried searching to see if the problem is in chilisoft but I haven't found anything yet. How did people search for a certain record before the rs.find method was invented? Maybe I should try and use that.
Thank you Billy
|
|
|
getwidth
Starting Member
15 Posts |
Posted - 19 April 2002 : 13:50:50
|
Thank you ruirib. Do you mean someting like this? I couldn't get it quite right.
RS.Open "SELECT * FROM mail_list where ID LIKE "request.form("Member")", objConn, 3, 3
|
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 19 April 2002 : 17:56:51
|
I probably would do it in two instrcutions, for the sake of clarity:
strSql = "SELECT * FROM mail_list WHERE ID='" & Request.Form("Member") & "';"
RS.Open strSql Conn
No need for the extra parameters in the Rs.Open instruction since the recordset will have a single record and you won't need to navigate back and forth in the recordset. Also, no point in slowing the operation now by creating a client side cursor, since you will not use the Find Method now.
I think this will work, but if it doesn't let me know.
------------------------------------------------- Installation Guide | Do's and Dont's | MODs |
|
|
getwidth
Starting Member
15 Posts |
Posted - 20 April 2002 : 18:41:52
|
Thank You, I get this: Microsoft VBScript compilation error '800a0401'
Expected end of statement
/mail/subscribers_edit2.asp, line 8
RS.Open strSql Conn ---------------^ I played around for it a bit. I am a amature at is still so I couldn't get it to work.
Billy
|
|
|
ruirib
Snitz Forums Admin
Portugal
26364 Posts |
Posted - 20 April 2002 : 18:52:27
|
quote:
Thank You, I get this: Microsoft VBScript compilation error '800a0401'
Expected end of statement
/mail/subscribers_edit2.asp, line 8
RS.Open strSql Conn ---------------^ I played around for it a bit. I am a amature at is still so I couldn't get it to work.
Billy
Of course, my fault, sorry. I forgot a "," between strSql and Conn:
RS.Open strSql, Conn
Try it again. Sorry about it.
------------------------------------------------- Installation Guide | Do's and Dont's | MODs
Edited by - ruirib on 20 April 2002 18:53:00 |
|
|
getwidth
Starting Member
15 Posts |
Posted - 21 April 2002 : 15:46:42
|
I found the initial problem with my code. RS.Find was a problem, we got that fixed with different code. But then as I said before, the update didn't put the form stuff in the right places. It put like the state, handle, and city all in the last name field. I didn't update the name of the fields when I added stuff. It looked something like this: <td bgcolor="#C5D3E7"><font face="Verdana" size="1" color="48576C"><b>Email</b></font></td> <td bgcolor="#C5D3E7"><input type="text" name="Email" value="<%=RS("Email")%>" class="inputbox" size="30" maxlength="255"></td> </tr> <tr> <td bgcolor="#C5D3E7"><font face="Verdana" size="1" color="48576C"><b>Handle</b></font></td> <td bgcolor="#C5D3E7"><input type="text" name="handle" value="<%=RS("handle")%>" class="inputbox" size="30" maxlength="255"></td> </tr> <tr> <td bgcolor="#C5D3E7"><font face="Verdana" size="1" color="48576C"><b>Last Name</b></font></td> <td bgcolor="#C5D3E7"><input type="text" name="Name_Last" value="<%=RS("Name_Last")%>" class="inputbox" size="30" maxlength="255"></td> </tr> <tr> <td bgcolor="#DAE3F0"><font face="Verdana" size="1" color="48576C"><b>First Name</b></font></td> <td bgcolor="#DAE3F0"><input type="text" name="Name_Last" value="<%=RS("Name_First")%>" class="inputbox" size="30" maxlength="255"></td> </tr> <tr> <td bgcolor="#C5D3E7"><font face="Verdana" size="1" color="48576C"><b>City</b></font></td> <td bgcolor="#C5D3E7"><input type="text" name="Name_Last" value="<%=RS("City")%>" class="inputbox" size="30" maxlength="255"></td> </tr> <tr> <td bgcolor="#C5D3E7"><font face="Verdana" size="1" color="48576C"><b>State</b></font></td> <td bgcolor="#C5D3E7"><input type="text" name="Name_Last" value="<%=RS("State")%>" class="inputbox" size="30" maxlength="255"></td> </tr> <tr> <td bgcolor="#DAE3F0"><font face="Verdana" size="1" color="48576C"><b>Date Joined</b></font></td> <td bgcolor="#DAE3F0"><input type="text" name="Date_In" value="<%=RS("Date_In")%>" class="inputbox" size="30" maxlength="255"></td> </tr>
Thank you all for your help and I greatly appreciate it. :-) :-D
|
|
|
|
Topic |
|