ejabberd - Comments for "Getting ejabberd working with MS SQL on Windows" https://www.ejabberd.im/node/626 en ODBC VCard Mod - MS SQL https://www.ejabberd.im/node/626#comment-2513 <p>It's been 9 months since the last comment in this thread, but I recently came across this same problem and thought I'd post the solution I used. As I'm neither an expert in ejabberd nor Erlang, any ideas concerning a better fix would be appreciated.</p> <p>I should point out that this is modified from the ejabberd 1.1.2 release, NOT the 1.0.0 release mentioned in the original topic.</p> <p>First, I uncommented this line in odbc_queries.erl and recompiled:</p> <div class="quote-msg"> <div class="quote-author"><em>odbc_queries.erl, line 37</em> wrote:</div> <p>%-define(mssql, true). </p></div> <p>Next, I modified mod_vcard_odbc.erl and recompiled:</p> <div class="quote-msg"> <div class="quote-author"><em>mod_vcard_odbc.erl, lines 496 - 509</em> wrote:</div> <pre> Val when is_integer(Val) and (Val &gt; 0) -&gt; [" TOP ", integer_to_list(Val)]; Val -&gt; ?ERROR_MSG("Illegal option value ~p. " "Default value ~p substituted.", [{matches, Val}, ?JUD_MATCHES]), [" TOP ", integer_to_list(?JUD_MATCHES)] end, case catch ejabberd_odbc:sql_query( LServer, ["select",Limit," username, fn, family, given, middle, " " nickname, bday, ctry, locality, " " email, orgname, orgunit from vcard_search ", MatchSpec, ";"]) of</pre></div> <p>In addition to modifying the source, I found the mssql.sql file was incorrect. The following is the appropriate schema:</p> <div class="quote-msg"> <div class="quote-author"><em>MSSQL VCard schema</em> wrote:</div> <pre> DROP TABLE [vcard] CREATE TABLE [vcard] ( [username] [varchar] (250) NOT NULL , [vcard] [varchar] (2000) NOT NULL , PRIMARY KEY CLUSTERED ( [username] ) ON [PRIMARY] ) ON [PRIMARY] GO CREATE TABLE [vcard_search] ( [username] [varchar] (250) NOT NULL , [lusername] [varchar] (250) NOT NULL , [fn] [varchar] (250) NOT NULL , [lfn] [varchar] (250), [family] [varchar] (250) NOT NULL , [lfamily] [varchar] (250) NOT NULL , [given] [varchar] (250) NOT NULL , [lgiven] [varchar] (250) NOT NULL , [middle] [varchar] (250) NOT NULL , [lmiddle] [varchar] (250) NOT NULL , [nickname] [varchar] (250) NOT NULL , [lnickname] [varchar] (250) NOT NULL , [bday] [varchar] (250) NOT NULL , [lbday] [varchar] (250) NOT NULL , [ctry] [varchar] (250) NOT NULL , [lctry] [varchar] (250) NOT NULL , [locality] [varchar] (250) NOT NULL , [llocality] [varchar] (250) NOT NULL , [email] [varchar] (250) NOT NULL , [lemail] [varchar] (250) NOT NULL , [orgname] [varchar] (250) NOT NULL , [lorgname] [varchar] (250) NOT NULL , [orgunit] [varchar] (250) NOT NULL , [lorgunit] [varchar] (250) NOT NULL , PRIMARY KEY CLUSTERED ( [lusername] ) ON [PRIMARY] ) ON [PRIMARY] GO</pre></div> <p>If there are any questions, I could post the actual files.</p> Wed, 08 Nov 2006 20:54:35 +0000 mr kevin comment 2513 at https://www.ejabberd.im ejabberd/odbc error text https://www.ejabberd.im/node/626#comment-1328 <p>=ERROR REPORT==== 1-Feb-2006::15:50:05 ===<br /> E(&lt;0.287.0&gt;:gen_iq_handler:67): {{case_clause,<br /> {error,<br /> "[Microsoft][ODBC SQL Server Driver][S<br /> L Server]Invalid column name 'vcard'. SQLSTATE IS: 42S22"}},<br /> [{mod_vcard_odbc,process_sm_iq,3},<br /> {gen_iq_handler,process_iq,6},<br /> {gen_iq_handler,queue_loop,3},<br /> {proc_lib,init_p,5}]}</p> Wed, 01 Feb 2006 20:57:40 +0000 mcannon comment 1328 at https://www.ejabberd.im Working Somewhat https://www.ejabberd.im/node/626#comment-1327 <p>Ok, I now have it authenicating and creating users against the SQL DB. However I am unable to add a contact or modify my vcard info. </p> <p>I will continue plugging away but if anyone has any idea's I would appreciate any help I can get.</p> <p>Mike</p> Wed, 01 Feb 2006 20:22:40 +0000 mcannon comment 1327 at https://www.ejabberd.im Re: Getting ejabberd working with MS SQL on Windows https://www.ejabberd.im/node/626#comment-1322 <div class="quote-msg"> <div class="quote-author"><em>mcannon</em> wrote:</div> <p>Now I am trying to authenicate against MS SQL and am having a lot of trouble getting it to work. I have read through posts and have downloaded the mssql.zip but I still cannot get the server to work off SQL.</p> <p>Has anyone been able to get it work and would you be willing to share your experience and ncessary steps?</p></div> <p>I have no experience with MS SQL, so I only can recommend you trying next things:</p> <ul> <li>Read the <noindex><a href="/mssql" rel="nofollow" >instructions to apply the MS SQL patch very carefully</a></noindex> and explain what goes wrong</li> <li>Read the threads (see bottom of that page)</li> <li>Try to contact Tiaan, the author of that patch (only if all the above do not help!)</li> </ul> Tue, 31 Jan 2006 21:07:54 +0000 sander comment 1322 at https://www.ejabberd.im