I have developed a xojo web app on my mac connecting to a remote mssql server successfully using actual tech’s mssql odbc driver for mac. Basically once I configured the connection I just connect to it’s data source name. Perfect!
I am now attempting to deploy to the live server windows 2008 (32 bit) server, on the same box as the mssql server. I have created a system DSN (using the same name as when developing so I don’t need to change code) using the Native Client 10 (32 bit) driver. I am however unable to connect to the database.
Dim db As New ODBCDatabase
db.DataSource = “WebOrders”
If db.Connect Then
MsgBox(“Connected”)
Else
MsgBox(“Connection error:” + db.ErrorMessage)
End If
The msgbox says ‘Connection error:[Microsoft][SQL Server Native Client 10.0]Dialog failed’
I read that link and the docs on ODBC connection strings for mssql server.
I tried a range of things, nothing has worked so far.
In my travels I had read that when using a named DSN, “SQL_DRIVER_NOPROMPT” is the default.
Regardless, I tried not using a named DSN and using my own connection string instead like:
db.DataSource = “Driver={SQL Server Native Client 10.0};DriverCompletion=SQL_DRIVER_NOPROMPT;UID=sa;PWD=****;SERVER=SYD1-0098DSB\BIZ;Database=WebSales” but it still bombs (with the same error message).
same with
db.DataSource = “Driver={SQL Server Native Client 10.0};DriverCompletion=SQL_DRIVER_NOPROMPT;UID=sa;PWD=****;SERVER=(local)\BIZ;Database=WebSales” but it still bombs (with the same error message).
*** for security they were populated correctly in my original.
I wonder if anyone has a working connection string they might like to share? Any other ideas Paul?
Yes it’s listening on standard port 1433 and the Browser service is running. These are User DSNs configured using C:\Windows\SysWOW64\ODBCAD32.EXE, running in W7-64 bit VM.
Note that the connection strings above were tested in dev, but in production I use the standard OS ODBC connection utilities. The IDE contains an inserted instance of the ODBC database. All primary dev is done on a Mac and uses the Actual SQL Server connector.
Why not stick with straight ODBC since you’re already using it successfully on the Mac? An identically named DSN should work on both platforms without tweaking, provided it’s installed using the correct ODBC Manager in Windows. MS notes here. I’ve had a few issues with System DSN’s on client machines, I now generally just use User DSN’s.
I did stick with straight ODBC using a similarly named System DSN. However I did (to satisfy the dialog error) pass username and password as params to the connection.
I didn’t notice that my clients server also had Cold Fusion installed which has it’s own ODBC Manager Service running which seemed to complicate matters when testing.
Eventually I reinstalled the Sql Server Native Client 10 driver, and all came good.
Besides the little db hurdle completing this project in Xojo as a web project has been a breeze and very well received by the client and their staff.