logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
SQLServer
Goto page Previous  1, 2, 3, 4, 5, 6  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related
View previous topic :: View next topic  
Author Message
chris421



Joined: 07 Apr 2005
Posts: 53

PostPosted: Sat Nov 15, 2008 21:19    Post subject: Reply with quote

OK I downloaded the pre-1.10 hook and the CTP SQL Server dll.

I'm running 32-bit SQL 2008 Standard--default instance--not named.

Quote:

NWNX SQLServer Plugin V.106.108.0.9 (CTP)
(c) 2007 by Rob Lobbe (Gryphyn)
visit us at http://www.nwnx.org

* Log level set to 1 (only errors)
Instance: .\
Database: NWN
Trusted connection
! [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
* Connection to SQLServer failed!


I've tried specifying both .\MSSQLSERVER and .\ in the xp_sqlserver.ini.

I've also tried with and without an ODBC DSN pointing to the native 2008 client called "MSSQLSERVER".

The NWN database is present & allows access to the service account running nwn2server.exe.

I uncommented "#class=SQLServer" and changed it to just "class=SQL".
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sun Nov 16, 2008 0:12    Post subject: Reply with quote

chris421 wrote:
OK I downloaded the pre-1.10 hook and the CTP SQL Server dll.

I'm running 32-bit SQL 2008 Standard--default instance--not named.

Quote:

NWNX SQLServer Plugin V.106.108.0.9 (CTP)
(c) 2007 by Rob Lobbe (Gryphyn)
visit us at http://www.nwnx.org

* Log level set to 1 (only errors)
Instance: .\
Database: NWN
Trusted connection
! [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
* Connection to SQLServer failed!


I've tried specifying both .\MSSQLSERVER and .\ in the xp_sqlserver.ini.

I've also tried with and without an ODBC DSN pointing to the native 2008 client called "MSSQLSERVER".

The NWN database is present & allows access to the service account running nwn2server.exe.

I uncommented "#class=SQLServer" and changed it to just "class=SQL".

You'll need the 2005 native client, as the CTP version hasn't been updated to know about the 2008 native client (I got caught out by that one as well)

Is the SQLServer2008 an express edition? (.\SQLEXPRESS)
Back to top
View user's profile Send private message
chris421



Joined: 07 Apr 2005
Posts: 53

PostPosted: Sun Nov 16, 2008 9:37    Post subject: Reply with quote

Gryphyn wrote:

You'll need the 2005 native client, as the CTP version hasn't been updated to know about the 2008 native client (I got caught out by that one as well)

Is the SQLServer2008 an express edition? (.\SQLEXPRESS)


Mine? No, it's Standard Ed. I get all my software through the Microsoft quarterly partner (action pack) subscription.

I would expect 2008 Express to still follow the .\SQLEXPRESS ID.

So I guess you're looking for a specific SQL 2005 native client driver then? The new one is SQLNCLI10.DLL.
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Mon Nov 17, 2008 9:34    Post subject: Reply with quote

Yes, the SQLServer2005 Native Client.
MS has a download for it somewhere...
Back to top
View user's profile Send private message
Sable



Joined: 24 Dec 2008
Posts: 10

PostPosted: Wed Dec 24, 2008 15:08    Post subject: Reply with quote

Apologies for what I am certain is going to be a stupid question, but I’m trying to convert an existing mod that uses MySQL over to SQL server as I’m far more used to it.

I’ve set up the instance of SQL Express 2005, imported the tables and Data from MySQL and configured it for external access by SQL server authentication (NWN and the DB are on separate servers and I don’t want to mess with Domains and the like atm). The connection and the like has been tested with Management Studio and by connecting MS Access via ODBC just to make sure all that works.

I’ve imported all the gubbins into the mod and resolved a few issues between the old scripts for NWNX and the new SQL server ones (they were using GetSQLData and obviously this has changed).

However, I can’t for the life of me get the connection on start up of NWNX to the DB to work. I’ve tried both setting the connection details

[SQLSERVER]
;++
;Connection
; Required information for creating a connection string
; if trusted=true, windows authentication is used
; otherwise you need a username/pasword combination
;--
nativeclient=2005
instance=192.168.1.21\SQLEXPRESS
database=nwn
trusted=false
username=Username
password=Password

;++
;Logging
; 0=Nothing
; 1=Errors
; 2=Everything
;--
logging=2

in both the NWNX.ini and/or in the nwnx_sqlserver.ini and any number of combinations there of, and each time I get the line

! Error while connecting to database: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
o Disconnecting from database.

I’ve even set up an System ODBC connection, but wasn’t sure what to call it as its not invoked in anything I could see, so called it 2005 for want of something better – though I assumed this was using a direct connection rather than ODBC.

I’m guessing theres some stuff still in from the old code for connecting to MySQL, but I can’t for the life of me find it. If this is the case, any suggestions where to look? Otherwise, is there anything glaring in the description that’s wrong?

Thanks in advance,

Sable
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Thu Dec 25, 2008 0:58    Post subject: Reply with quote

At a guess (as you've got NWN & SQLServer on different machines)
Make sure that you have the "2005 Client" installed on the NWN machine.
You need this to let the NWN machine talk to the SQLServer database.

And (just in case...)
Trusted=false
so you need a valid username/password to connect.

XMas Cheers
Gryphyn
Back to top
View user's profile Send private message
Sable



Joined: 24 Dec 2008
Posts: 10

PostPosted: Thu Dec 25, 2008 21:13    Post subject: Reply with quote

sadly "Microsoft SQL Server Native Client" is installed on the machine I'm using to test. It isn't on the live machine, so its something to note for when going live, so thanks for that Smile

I guess the question could be as simple as, the ODBC connection has so far always looked to the NWNX.ini for its details, which part of adding the SQL server stuff tells it to look at the nwnx_sqlserver.ini? I'm guessing thats where I've prolly goofed it up.

Thanks again, and I hope you had a great Christmas

Sable
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Fri Dec 26, 2008 1:58    Post subject: Reply with quote

Sable wrote:
sadly "Microsoft SQL Server Native Client" is installed on the machine I'm using to test. It isn't on the live machine, so its something to note for when going live, so thanks for that Smile

I guess the question could be as simple as, the ODBC connection has so far always looked to the NWNX.ini for its details, which part of adding the SQL server stuff tells it to look at the nwnx_sqlserver.ini? I'm guessing thats where I've prolly goofed it up.

Thanks again, and I hope you had a great Christmas

Sable


Yes, nwnx_sqlserver.ini is where the config is stored. I did this specifically so you could run BOTH MySQL & SQLServer databases . To allow for a conversion period, where you could gradually do the migration - with minimal downtime.

But alas Christmas is over - it was one of the better ones Wink

Cheers
Gryphyn
Back to top
View user's profile Send private message
Sable



Joined: 24 Dec 2008
Posts: 10

PostPosted: Fri Dec 26, 2008 18:36    Post subject: Reply with quote

drat! looks as if the stuff I put earlier was a red herring Sad Embarassed

The real problem appears to be in this statement:

NWN Extender V.2.6.1
(c) 2005 by Ingmar Stieger (Papillon) and Jeroen Broekhuizen
visit us at http://www.nwnx.org

* Loading plugins...
* Plugin odbc is loaded.
* An error occured while loading extension sqlserver (14001: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. )
* NWNX2 activated.


Any suggestions would be gratefully recieved,

thanks muchly and I hope this isn't getting too irritating

Sable
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sat Dec 27, 2008 0:32    Post subject: Reply with quote

14001: looks like the VC++ Runtime needs to be installed.
--I've got a link to in on my contributions page.

Cheers
Gryphyn
Back to top
View user's profile Send private message
Sable



Joined: 24 Dec 2008
Posts: 10

PostPosted: Sat Dec 27, 2008 14:31    Post subject: Reply with quote

Hi, thanks, that did the trick! Very Happy

A little feedback I think is owed. Other than being the one thing I've been praying for a few years to see for NWN1 that is Smile

Theres a very little bug in the nwnx_apsmode script. The GetPersistentFloat function reads:

Code:

float GetPersistentFloat(object oObject, string sVarName, string sTable = "pwdata")
{
  return StringToFloat(GetPersistentString(oObject, sVanName, sTable));
}


its just a mistype in the section sVanName, rather than sVarName, but the sort of one that can have you reading it over and again and not seeing.

The next one I'm not too sure on, whilst I have Visual Studio 2008 on my work machine, I've only just started trying to teach myself how to use it and languages other than SQL and VBA (I work almost exclusively in SQL). Looking at the source files, and through trying to work this, it looks to me that when building the connection string, theres a hardcoded setting of the Trusted Connection property. Could be wrong though, either way, regardless of what I put in the ini file, the logs report that trusted connection is always set to true and the connection to the DB fails due to the account on the Dev machine.

Hope that helps,

Thanks again

Sable
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sun Dec 28, 2008 0:09    Post subject: Reply with quote

Sorry about that, must have slipped through when I had problems updating my contributions page...

Code:

   iniFile->Read(wxT("/SQLSERVER/trusted"), &odbcTrusted, true);
   iniFile->Read(wxT("/SQLSERVER/username"), &odbcUsername, wxEmptyString);
   iniFile->Read(wxT("/SQLSERVER/password"), &odbcPassword, wxEmptyString);
...
   if (odbcTrusted || odbcUsername == wxT(""))
   {
      odbcTrusted = true;
      Log("! Trusted Connection\n");
   }
   else
   {
      Log("! Username: %s\n", odbcUsername.utf8_str());
      Log("! Password: ******\n");
   }
...
   if (odbcTrusted)
      odbcDriver.Append(wxT("Trusted_Connection=yes;"));
   else
      odbcDriver.Append(wxString::Format(wxT("Uid={%s};Pwd={%s};"), odbcUsername, odbcPassword));


odbcTrusted defaults to true
(if the .INI name is not set OR the username is 'blank')
--check for 'case sensitivity' in the .INI file

Cheers
Gryphyn

PS. I'll try to update the contribution when I can.
Back to top
View user's profile Send private message
chris421



Joined: 07 Apr 2005
Posts: 53

PostPosted: Sun Dec 28, 2008 2:17    Post subject: Reply with quote

Gryphyn wrote:
PS. I'll try to update the contribution when I can.


And when you get around to posting your new documentation and binaries, can you please build a release against the 2008 native client? Really don't want to back rev any piece of my installation to SQL 2005 if I don't have to. SQL 2008 native client is supposedly backward compatible.

Thanks!
Back to top
View user's profile Send private message
Gryphyn



Joined: 20 Jan 2005
Posts: 431

PostPosted: Sun Dec 28, 2008 3:11    Post subject: Reply with quote

Thanks guys Very Happy
After finally pulling my finger out...

There's a new update on my contributions page.

It includes several minor tweaks and;
nativeclient=2008 (.INI to support SQLServer2008)
and 'full support' for objects as parameters (previously restricted to 1 object as the last parameter)

SQLServer2008.rar --> the source
nwnx_sqlserver2008.rar --> the plugin

Cheers
Gryphyn
Back to top
View user's profile Send private message
chris421



Joined: 07 Apr 2005
Posts: 53

PostPosted: Sun Dec 28, 2008 3:14    Post subject: Reply with quote

Gryphyn, YOU ROCK!!!

I'll mess around with it tomorrow.

Thanks.

Smile

EDIT: Doh! I'm using NWN2. This release is for the old game only. PM me if you build one for NWNX4.

Razz
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Database related All times are GMT + 2 Hours
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Page 3 of 6

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group