[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
eXept User Forum • View topic - SQLServer
Page 1 of 2

SQLServer

PostPosted: 15. Feb 2009, 21:30
by JayBee
Hi,

Has anyone been able to access a SQLServer database from STX?
Either by ODBC or in another way?
If so, please give an example of how this is done.

Regards,

Jan

Re: SQLServer

PostPosted: 29. Apr 2009, 22:10
by cgittinger

Re: SQLServer

PostPosted: 9. May 2009, 18:19
by JayBee
When I create an ODBC definition in windows and then evaluate the following code:

| session |
session := SQL::ODBCSession new.
session connectWithUsername:'blabla' password: 'blablaToo' dbname: 'TestDB'.
session disconnect

it ends with an exception:

[Microsoft][ODBC SQL Server Driver][SQL Server]Changed language setting to us_english.

When I change the default language of the ODBC connection into Dutch, the message changes to:

[Microsoft][ODBC SQL Server Driver][SQL Server]Changed language setting to nederlands

This should not be handled as an exception, but as a normal message.

Re: SQLServer

PostPosted: 12. May 2009, 17:13
by mbeyl
Hello,
here is a patch for the ODBCSession class.
File in the ".chg" file.
When connecting, "success with info" is now handled in the right way.

The problem is solved in newer versions starting with 5.4.5.

Regards,

Michael

Re: SQLServer

PostPosted: 13. Feb 2010, 01:03
by duetto
hi all,

this is related to this thread.

my question is, where does the selecting the correct odbc driver happen (i.e. what class)?

i'm trying to connect to an odbc datasource with no success. i have successfully connected to the datasource with other tools.

john cummings

Re: SQLServer

PostPosted: 27. Feb 2010, 16:31
by JayBee
Hi John,

I would expect the ODBCSession.
What error do you get when connecting to the ODBC datasource?

Best regards,

Jan

Re: SQLServer

PostPosted: 3. Mar 2010, 15:43
by duetto
hi jan,

thanks for getting back to me.

first let me point out that the datasource is a sqlite database.

the bottomline is that it's failing in new. the environment handle is nil.

here is the code.

john

***********************

|session|

session := SQL::ODBCSession new. <====== failing here environmentHandle is nil
session initializeDatabaseHandle.
session connectWithUsername:'' password:'' dbname:'stxtestdb'. "odbc user dsn"
Transcript showCR:'Connected'.
session disconnect.
Transcript showCR:'Disconnected'.

Re: SQLServer

PostPosted: 14. Mar 2010, 12:35
by JayBee
John,

I assume you are running STX under some Windows version (XP, Vista, Server ...) and have defined an ODBC datasource.
Can you communicate with the database e.g. from Excel?

Jan

Re: SQLServer

PostPosted: 14. Mar 2010, 14:31
by duetto
hi jan,

yes, i am able to access table structure and data using 2 other tools that i have.

i still don't understand where STX learns about "DSN=...." or "DRIVER=...".

also, why does the odbc session have a nil handle returned from new?

i guess these are more rhetorical questions.

anyway, thanks for your help.

john

Re: SQLServer

PostPosted: 19. Mar 2010, 23:03
by JayBee