Author |
Topic |
@tomic
Senior Member
USA
1790 Posts |
Posted - 11 September 2002 : 22:25:33
|
<% if (strDBType = "mysql") then on error resume next
if (my_Conn.State = 0) Then my_Conn.Open strConnString end If
strSql = "DROP TABLE IF EXISTS dictionary"
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords ChkDBInstall()
strSql = "CREATE TABLE dictionary ( " strSql = strSql & "word TEXT DEFAULT '' NOT NULL " strSql = strSql & " )"
my_Conn.Execute (strSql),,adCmdText + adExecuteNoRecords ChkDBInstall()
on error goto 0
end if
sub ChkDBInstall() for counter = 0 to my_Conn.Errors.Count -1 ConnErrorNumber = my_Conn.Errors(counter).Number ConnErrorDescription = my_Conn.Errors(counter).Description
if ConnErrorNumber <> 0 or Err.Number <> 0 then Err_Msg = "<tr><td bgColor=""red"" align=""left"" width=""30%""><font face=""Verdana, Arial, Helvetica"" size=""2""><b>Error: " & ConnErrorNumber & "</b></font></td>" Err_Msg = Err_Msg & "<td bgColor=""lightsteelblue"" align=""left""><font face=""Verdana, Arial, Helvetica"" size=""2"">" & ConnErrorDescription & "</font></td></tr>" Err_Msg = Err_Msg & "<tr><td bgColor=""red"" align=""left"" width=""30%""><font face=""Verdana, Arial, Helvetica"" size=""2""><b>strSql: </b></font></td>" Err_Msg = Err_Msg & "<td bgColor=""lightsteelblue"" align=""left""><font face=""Verdana, Arial, Helvetica"" size=""2"">" & strSql & "</font></td></tr>"
Response.Write(Err_Msg) intCriticalErrors = intCriticalErrors + 1 end if next my_Conn.Errors.Clear
%>
I think you could just link to that on your admin_home.asp....call it dictionary_mysql_setup.asp
Should do the setup. Someone please correct me if I'm wrong. I am just taking this from the Snitz mySQL setup script. I'm not sure what code creates an index and this MOD really needs one as it speeds up word searches by a very noticable amount.
And how do you get the words out of the Access database and into mySQL?
There are other changes too but I would get to this point with the table and it's one field created and get the words imported. The rest is super easy after that.
@tomic |
SportsBettingAcumen.com |
Edited by - @tomic on 11 September 2002 22:26:18 |
|
|
bobbart
Junior Member
USA
163 Posts |
Posted - 11 September 2002 : 22:45:49
|
So thats just to create the table and the 1 field? |
|
|
@tomic
Senior Member
USA
1790 Posts |
|
bobbart
Junior Member
USA
163 Posts |
Posted - 11 September 2002 : 23:13:04
|
ok thats the easy part I can do that. I think I can also import the words.
What I will need help with is using the forum connect sring and what ever else will need to change.
|
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 11 September 2002 : 23:40:59
|
You will need to take a look at line 93 of pop_spellcheck.asp:
set SpellConn = Server.CreateObject("adodb.connection")
SpellConn.open spellConnStr
set rs = SpellConn.execute(sql)
Lose what's in red. You already have an open connection to this database. Make it look like this:
set rs = my_Conn.execute(sql)
Then around line 102:
SpellConn.close
set SpellConn = nothing
set rs = nothing
Once again lose the red part. Sitz will close the connection when it is time.
That should do it.
@tomic
|
SportsBettingAcumen.com |
Edited by - @tomic on 11 September 2002 23:41:46 |
|
|
bobbart
Junior Member
USA
163 Posts |
Posted - 12 September 2002 : 00:38:20
|
Ok I did all that and seems to be good. But when I try to spellcheck I get this.
ADODB.Recordset.1 error '80004005'
SQLState: S1000
Native Error Code: 1146
[TCX][MyODBC]Table 'ewo_us.dictionary' doesn't exist
/~gsuru/pop_spellcheck.asp, line 58
I understand the error. And need to change dictionary to GSURU_DICTIONARY I thought it would get the GSURU_ from the config.asp
So what I did was find this line
sql = "select word from dictionary where word in ("
and changed it to this
sql = "select word from GSURU_DICTIONARY where word in ("
Now I get no errors but the window states " There are no words to spell check. " This is not true I typed a few bad spellings. |
Edited by - bobbart on 12 September 2002 01:30:03 |
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 12 September 2002 : 01:54:15
|
OK, good catch on the table name. Have you filled the dictionary table with words and do you see what you typed in the spellcheck/preview window? If the table has no words in it there is no way of checking anything. It is BOF and we all know how painful that can be.
@tomic |
SportsBettingAcumen.com |
|
|
bobbart
Junior Member
USA
163 Posts |
Posted - 12 September 2002 : 02:01:52
|
I have the table created and the words in it. The test does not show in the preview window of the spellcheck popup. All it says is There are no words to spell check. |
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 12 September 2002 : 03:25:24
|
Does the normal preview work? What it's saying is that id did not receive anything from post.asp. If you look at the very top of pop_spellcheck.asp you can see why that text is displayed
@tomic |
SportsBettingAcumen.com |
|
|
bobbart
Junior Member
USA
163 Posts |
Posted - 12 September 2002 : 10:44:37
|
Yes normal preview works. |
|
|
crash
Advanced Member
Netherlands
2064 Posts |
Posted - 12 September 2002 : 19:42:36
|
has anyone tried hitting the spell check button with just a smilie in the message field? it returns a nice little error... |
cHosting.nl |
|
|
bobbart
Junior Member
USA
163 Posts |
Posted - 14 September 2002 : 13:57:27
|
So any idea why the pop_spellcheck is not getting the test? It is different than what pop_preview is doing. But I am not an ASP expert so I am not going to try to much without help.
|
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 14 September 2002 : 14:09:02
|
Shoot sorry bobbart. I haven't had a chance to look at it but it's requesting the text you typed from your cookie. Are you using Chilisoft or anything like that?
@tomic |
SportsBettingAcumen.com |
|
|
bobbart
Junior Member
USA
163 Posts |
Posted - 14 September 2002 : 15:10:24
|
Saddly yes. I normaly used win2000 but I am now tring to host on Chilisoft. |
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 14 September 2002 : 15:19:14
|
Yikes. I am 100% unfamiliar with Chilisoft. Perhaps there is some cookie code specific to that in there? I don't recall seeing that but the problem is either getting the text into the cookie on post.asp or out of the cookie on pop_spellcheck.asp or both. Yeah that's a great help I know, but the code in the zip has worked fine for everyone so far at least as far as the cookie goes.
@tomic |
SportsBettingAcumen.com |
|
|
Topic |
|