Author |
Topic  |
slemieux
Junior Member
 
USA
234 Posts |
Posted - 08 December 2000 : 21:40:11
|
Think MS will ever have a useful site where real people can find real answers?
Since I have never had this problem anywhere else I am betting it's this server with the issue (not that it couldn't be others). The two things that are typically screwy are MDAC and ODBC. And while I would almost always bet the farm on MDAC, I searched the knowledge base and found this
So if this forum isn't using ODBC, then I just wasted a bunch of bandwidth 
As far as MySQL it's been a couple months since I worked with it, but it is 100% ANSI SQL compliant, so the instert statement shouldn't be a problem. MySQL supports recordsets but last I checked didn't support any type of locking or cursor location.
Anyone simply tried changing the way this forum connects to the database? I use SQLOLEDB without any problems.
Scott LeMieux< |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 08 December 2000 : 22:25:02
|
Thanks MS, that's a really useful article.
'Resistance is futile'< |
 |
|
work mule
Senior Member
   
USA
1358 Posts |
Posted - 09 December 2000 : 13:39:39
|
quote: Since I have never had this problem anywhere else I am betting it's this server with the issue
I tried to taking the same information that I tried to post on Snitz and posted it on my development forum at home. It posted with no problem. On here (Snitz) I received the error that I posted earlier in this topic.
< |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 09 December 2000 : 14:44:19
|
quote:
Here some tip: use:
Dim objRecordset Set objRecordset = Server.CreateObject("ADODB.Recordset") ' data in the table. objRecordset.Open "TableName",DB_CONNECTIONSTRING,adOpenKeyset,adLockPessimistic,adCmdText objRecordset.AddNew objRecordset.Fields("text_field") = CStr(WeekdayName(WeekDay(Date()))) objRecordset.Fields("integer_field") = CInt(Day(Now())) objRecordset.Fields("date_time_field") = Now() objRecordset.Update ' Get the DB assigned ID of the record we just added. iRecordAdded = objRecordset.Fields("id").Value objRecordset.Close Set objRecordset = Nothing
This doesn't appear to work in mysql. In the who's online mod, in onine2.asp, is the following code
if rsWho.eof or rsWho.bof then Set objRS2 = Server.CreateObject("ADODB.Recordset") objRS2.Open "FORUM_ONLINE", objConn, 1, 2, 2 objRS2.AddNew objRS2("UserID") = User objRS2("Status") = "LOGIN" objRS2("DateCreated") = fDate objRS2("CheckedIn") = CheckInTime objRS2("M_BROWSE") = Location objRS2.Update objRS2.close else strSql = "UPDATE FORUM_ONLINE SET M_BROWSE = '" & Location & "' , DateCreated = '" & fDate & "' WHERE UserID = '" & User & "'" my_Conn.Execute (strSql) end if
Using mysql it fails with the following error 3219 | Operation is not allowed in this context.
if you change the code to
if rsWho.eof or rsWho.bof then on error resume next Set objRS2 = Server.CreateObject("ADODB.Recordset") strSQL = "INSERT INTO " & strTablePrefix & "ONLINE ( UserID,Status,DateCreated,CheckedIn,M_BROWSE) VALUES (" strSql = strSQL & User & ",'LOGIN','" & fDate & "','" & CheckInTime & "','" & Location & "')" my_Conn.Execute (strSql) if err.number <> 0 then response.write err.number & "|" & err.description else strSql = "UPDATE FORUM_ONLINE SET M_BROWSE = '" & Location & "' , DateCreated = '" & fDate & "' WHERE UserID = '" & User & "'" my_Conn.Execute (strSql) end if
everything works OK.
'Resistance is futile'< |
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 09 December 2000 : 16:02:23
|
quote: Since I have never had this problem anywhere else I am betting it's this server with the issue (not that it couldn't be others). The two things that are typically screwy are MDAC and ODBC. And while I would almost always bet the farm on MDAC, I searched the knowledge base and found this
When I read this article, it sounded like an explanation of why you might receive an error message using ODBC vs. ISQL, not what the error message actually was.
I don't find much info on 80040e57 either, though. 
====== Doug G ======
Edited by - Doug G on 09 December 2000 16:03:23< |
 |
|
tilttek
Junior Member
 
Canada
333 Posts |
Posted - 10 December 2000 : 12:18:37
|
quote:
This doesn't appear to work in mysql. In the who's online mod, in onine2.asp, is the following code
if rsWho.eof or rsWho.bof then Set objRS2 = Server.CreateObject("ADODB.Recordset") objRS2.Open "FORUM_ONLINE", objConn, 1, 2, 2 objRS2.AddNew objRS2("UserID") = User objRS2("Status") = "LOGIN" objRS2("DateCreated") = fDate objRS2("CheckedIn") = CheckInTime objRS2("M_BROWSE") = Location objRS2.Update objRS2.close else strSql = "UPDATE FORUM_ONLINE SET M_BROWSE = '" & Location & "' , DateCreated = '" & fDate & "' WHERE UserID = '" & User & "'" my_Conn.Execute (strSql) end if
Using mysql it fails with the following error 3219 | Operation is not allowed in this context.
if you change the code to
if rsWho.eof or rsWho.bof then on error resume next Set objRS2 = Server.CreateObject("ADODB.Recordset") strSQL = "INSERT INTO " & strTablePrefix & "ONLINE ( UserID,Status,DateCreated,CheckedIn,M_BROWSE) VALUES (" strSql = strSQL & User & ",'LOGIN','" & fDate & "','" & CheckInTime & "','" & Location & "')" my_Conn.Execute (strSql) if err.number <> 0 then response.write err.number & "|" & err.description else strSql = "UPDATE FORUM_ONLINE SET M_BROWSE = '" & Location & "' , DateCreated = '" & fDate & "' WHERE UserID = '" & User & "'" my_Conn.Execute (strSql) end if
everything works OK.
I did look at you code closely and sould work. What's objConn?
Philippe Gamache http://www.tilttek.com http://www.lapageamelkor.com< |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 10 December 2000 : 12:36:14
|
Set objConn = Server.CreateObject("ADODB.Connection") objConn.ConnectionString = strConnString objConn.Open
'Resistance is futile'< |
 |
|
tilttek
Junior Member
 
Canada
333 Posts |
Posted - 11 December 2000 : 08:57:54
|
quote:
Set objConn = Server.CreateObject("ADODB.Connection") objConn.ConnectionString = strConnString objConn.Open
'Resistance is futile'
In objRS2.Open "FORUM_ONLINE", objConn, 1, 2, 2 change it for objRS2.Open "FORUM_ONLINE", strConnString, 1, 2, 2
I don't have my code here, nor my book, so I can't validate... I'm at work in Java... But looking at the code I did send, this might do the trick. I'll try to retest this...
Philippe Gamache http://www.tilttek.com http://www.lapageamelkor.com< |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 15 December 2000 : 06:10:03
|
According to IIS
To optimize performance, avoid using the ADO record addition and deletion methods, such as AddNew and Delete. If your application adds and deletes records intensively, your application will perform better if it uses direct SQL statements, such as INSERT.
'Resistance is futile'< |
 |
|
tilttek
Junior Member
 
Canada
333 Posts |
Posted - 15 December 2000 : 09:28:09
|
quote:
According to IIS
To optimize performance, avoid using the ADO record addition and deletion methods, such as AddNew and Delete. If your application adds and deletes records intensively, your application will perform better if it uses direct SQL statements, such as INSERT.
Good thing to know... But I think they mean More that 1 Record at once.
Philippe Gamache http://www.tilttek.com http://www.lapageamelkor.com< |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 15 December 2000 : 09:39:16
|
tiltek,
did you manage to find out why I was getting the error on MYSQL ?
'Resistance is futile'< |
 |
|
tilttek
Junior Member
 
Canada
333 Posts |
Posted - 15 December 2000 : 15:32:20
|
I didn't have the time to look at it... I know there are some problems with ADO (it's documented on MySQL site), but it's not our problem. Are you using MySQL (I don't remember if it install its self with MySQL for Window)?
I hope to have time to look at it this week end. But I'm not sur. I wont be at home very often.
Philippe Gamache http://www.tilttek.com http://www.lapageamelkor.com< |
 |
|
HuwR
Forum Admin
    
United Kingdom
20600 Posts |
Posted - 15 December 2000 : 15:52:15
|
I don't use it, I was hust testing some install scripts for the Mods, so I figured I would test the whole site.
'Resistance is futile'< |
 |
|
Reinsnitz
Snitz Forums Admin
    
USA
3545 Posts |
Posted - 05 January 2001 : 14:40:06
|
Considering this a feature of the Database in question/Hardware the DB is running on as opposed to a forum related issue.
Closing This and it's sibling topic at: http://forum.snitz.com/forum/link.asp?TOPIC_ID=1518 also, I'm moving this topic to the FAQ forum for Heptite to note in her work there.
Reinsnitz (Mike) ><)))'> "The glory of young men is their strength, and the honor of old men is their gray hair." - Proverbs 20:29 < |
 |
|
Topic  |
|