"uspecificeret fejl i C# irc-bot"
i denne del af koden får jeg fejl-----kode-----
inputLine = inputLine.Split(':')[2].ToLower().Replace(NICK.ToLower() + " t ", "");
inputLine = inputLine.Replace(NICK.ToLower() + " translate ", "");
writer.WriteLine (outputline("NOTICE " + nickname + " :Oversættelser af : " + inputLine));
writer.Flush();
Thread.Sleep(1000);
// this.sql = "select en,da,la from translate where (da like \"%" + inputLine + "%\" or da = \"" + inputLine + "\") OR (en like \"%" + inputLine + "%\" or en = \"" + inputLine + "\") OR (la like \"%" + inputLine + "%\" or la = \"" + inputLine + "\")";
this.sql = "select en,da,la from translate where da like \"%" + inputLine + "%\" or da = \"" + inputLine + "\" OR en like \"%" + inputLine + "%\" or en = \"" + inputLine + "\" OR la like \"%" + inputLine + "%\" or la = \"" + inputLine + "\"";
writer.WriteLine("NOTICE " + nickname + " : - " + this.sql);
writer.Flush();
Thread.Sleep(1000);
dbasers.Open(sql, dbasers.ActiveConnection, dbasers.CursorType, dbasers.LockType, 0);
writer.WriteLine (outputline("NOTICE " + nickname + " :"+dbasers.Status));
writer.Flush();
if(!dbasers.EOF)
{
writer.WriteLine("NOTICE " + nickname + " :Dansk : " + dbasers.Fields["da"].Value.ToString());
writer.Flush();
Thread.Sleep(1000);
writer.WriteLine("NOTICE " + nickname + " :Engelsk : " + dbasers.Fields["en"].Value.ToString());
writer.Flush();
Thread.Sleep(1000);
writer.WriteLine("NOTICE " + nickname + " :Latin : " + dbasers.Fields["la"].Value.ToString());
writer.Flush();
}
else
{
writer.WriteLine (outputline("NOTICE " + nickname + " :Intet fundet"));
}
dbasers.Close();
-----kode-----
NICK er sibylin
nickname er underordnet
inputLine kan være "sibylin t lavendel" eller "sibylin translate lavendel"
fejlen jeg får er :
System.Runtime.InteropServices.COMException (0x80004005): Uspecificeret fejl
at ADODB.RecordsetClass.Open(Object Source, Object ActiveConnection, CursorTypeEnum CursorType, LockTypeEnum LockType, Int32 Options)
at Sibyline.IrcBot.GoOnline() in c:\documents and settings\daniel\dokumenter\visual studio projects\sibyline\ircbot.cs:line 319
(linie 319 er dbasers.open-linien)
SQL-statementet er bekræftet fungerende (både det udkommenterede, og det ikke)
jeg bruger line 319 et andet sted uden fejl
Hvis der er noget jeg mangler at fortælle, så skriv det lige