I don't know if anyone have posted some kind of manual about mssql, but here's the why I've done it:
(Tested on Microsoft SQL Server 2000 Enterprise Edition.)
Part 1: Creating the database.
As you might know, the included .sql file doesn't work with MSSQL. To override this, I've:
a. installed MySQL and imported the .sql file.
b. installed MySQL ODBC Driver.
c. imported the databases from the MySQL server to the MSSQL server using the ODBC driver.
(d. Here something went wrong - The Auto Inc. fields weren't set as such so I had to manually set them the old way - one table at a time. you might wanna check the default value of the different fields while you're at it.)
Part 2: db\mssql.php.
It seems that the MSSQL layer has some issues that the phpbb team didn't handle. most of them are simple lower vs. upper case, but they also didn't know that the now() function should be replaced with getdate() in mssql. So to function sql_query() in mssql.php i've added at the beginning:
--- EDIT: Please see fix in newer post below. ---
Part 3: Reserved Words (bad programing=hard work)
There are many words that shouldn't have been used for programing as far as I see it, but it a bit too late now. Anyway, these are the reserved words (for mssql anyway) that I've found (i've added a 'n_' prefix to them in order to fix them, but it's a lot of work):
date *
position (btw, in the table "blocks", it was already called bposition...)
view
action *
time *
timeStamp
hour
year
month
var
count
* - be careful when renaming those, since they are also used for legit functions such as $time() and "<action=" in html.
4. Part 4: MSSQL - Null bug?
The last issue I came across was that if field of a query was a null, for some reason sometimes it was returned as " " (a space) or (0) (a zero). so in some cases, I had to change the code from -
if (<somefield> == '') {}
and such, to something like-
if (trim(<somefield>) == '') {}
--------------------------------
Anyway, this is what I've found so far. basic checks looks ok, but I guess there's still stuff to fix. I'll try to keep you updated.
Last edited by BarakRL on Fri Feb 02, 2007 2:31 am; edited 1 time in total
BarakRL Nuke Cadet
Joined: Jan 23, 2007
Posts: 6
Posted:
Tue Jan 23, 2007 2:33 pm
well... It seems I spoke way too soon.
There's a BIG problem with the INSERT INTO queries which doesn't specify the "fields" into which the values are inserted [i.e. "insert into SomeTable values (list of values)" VS. "insert into SomeTable (list of fields) values (list of values)"]. The prblem is caused by the Auto number fields which while in MySQL could have been assigned a NULL which was ignored, this NULL triggers an error in MSSQL.
(google for SET IDENTITY_INSERT tablename ON/OFF.)
SO, since I don't wanna go the "lets rewrite every insert into query" way, I'm writing a function which I'll add to the data layer that will add the names of the relevant fields to the problematic query (and will remove the invalid nulls).
Again, I'll be back.
Evaders99 Site Admin
Joined: Aug 17, 2003
Posts: 12403
Posted:
Tue Jan 23, 2007 11:00 pm
Sounds like a lot of work to make compliant. Best of luck on this
(an extra space at the end of the query will prevent the LIMIT fix from working.)
well, that's all (for this week anyway...)
rugbykp Nuke Cadet
Joined: Feb 05, 2007
Posts: 1
Posted:
Mon Feb 05, 2007 9:06 am
I can't seem to get it working with the mssql-odbc connection. I get this message on the admin.php page: "There seems to be a problem with the mssql-odbc server, sorry for the inconvenience." Here's my config:
$dbhost = "localhost";
$dbuname = "nuke_user"; #my sql 2005 user
$dbpass = "nuke_pwd";
$dbname = "my_nuke"; #the db name AND the System ODBC name
$prefix = "my_nuke"; #no clue if this is correct
$user_prefix = "nuke_user"; #no clue if this is correct
$dbtype = "mssql-odbc";
$sitekey = "SdFk*jkjbkuuz-dm98769.4b67DS+e4";
$gfx_chk = 0;
$subscription_url = "";
$admin_file = "admin";
$tipath = "images/topics/";
$nuke_editor = 1;
$display_errors = true;
Am I completely missing something here? I'm running this on Windows XP and Apache 2.2. I'm new to both PHP and Apache, so I apologize for the (probably) simple question.
Also, if the mssql-odbc DB layer is the problem, can you post or send me your working version? Thanks.
BarakRL Nuke Cadet
Joined: Jan 23, 2007
Posts: 6
Posted:
Tue Feb 06, 2007 8:12 am
I haven't tried using MSSQL via ODBC, but directly so I use:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum