console app and odbcDatabase class

I have a problem on a windows 2003 server.
Im a Pro user with Xojo 2013 3.3
I apologise I seem to have put this in the wrong thread and don’t know how to change it to the “PRO” thread.

The objective is creating a server backend for desktop smart clients.
To do this I will have a classic ASP page call a console app to gather the data and update the MSSQLSERVER.

I wish to run a console app from a classic ASP web page. This is fine.
I can create a console app test and it runs well.

I want this console app to contact our MSSQL Server.
I can create a desktop app to use the 32bit OBDC driver and access the MSSQLSERVER from the server desktop.

My problem is using the exact same code in a console app. It doesn’t work.
i get the following error message
“Error connecting to MS SQL Server: [Microsoft][ODBC SQL Server Driver]Dialog failed”

I cut the code all the way down to this…
Dim mDB as ODBCDatabase
mDB = new ODBCDatabase
and I still have the same problem. I don’t actually have to try and connect to a DB just create an instance of the OBDCDatabase class to cause it?

To further complicate the story, I have run this console app successfully on a windows 2008 server which actually hosts the MSSQLSERVER .

I have no idea what the differences are? On both Im logged in VIA RDP as administrator.
The plugin for ODBC is in the lib directory.
Im not sure where to turn next???

Sounds like the difference is between the libraries installed on Windows Server 2003 vs Server 2008
Snince the app works on 2008 but not 2003 without any other changes that would be where I’d suspect the issue lies

Thanks for your thoughts. But why does it work on the desktop app and not the console?

The 2003 driver is complaining that it can’t show a dialog. The 2008 driver apparently doesn’t need to show the dialog, so it doesn’t throw the error. Desktop apps can show dialogs. Console apps cannot. That’s the difference.

Thanks Tim
This sort of explains it. I can’t change the environment. So not sure I can win here. May have to look outside of xojo for my backend. Thanks for you guys help

[quote=47512:@james Nicholson-Plank]I cut the code all the way down to this…
Dim mDB as ODBCDatabase
mDB = new ODBCDatabase
and I still have the same problem. I don’t actually have to try and connect to a DB just create an instance of the OBDCDatabase class to cause it?[/quote]
It seems odd that just instantiating would cause an error, especially considering the error message specifically mentions it cannot connect:

Perhaps you do have a call to “Connect” somewhere? Connecting to ODBC without specifying a DataSource will attempt to display a dialog.

I should have been clearer the error message was for my full test with a connect.
Then I cut the code down to a simple instance creation call as above and simply watched it hang and time out. I didn’t collect the error message for my last test. I will do this tonight.

I still can’t see any obvious problem to fix. So I can’t see a way to…

Use a console app in a 2003 server that accesses a MSSQLSERVER

Have you tried using the MSSQLServerDatabase class instead of ODBCDatabase?

I used this initially but it complained about the SQL native client not being installed. However it was. I assumed it was a 32 bit 64 bit problem . Looking up the forum I found similiar issues and the solution was to switch to odbc. So that’s what I tried and that’s where it is. Thanks