Originally Posted by
d_stranz
If I am not mistaken (and I easily could), that string should be the same that you have in your odbc.ini and freetds.conf files in between brackets. So, it's config dependant. But the examples out there are varied and there's no extensive documentation that I could find about this thing.
I've used odbc in the past, not with qt though. My QtSql experience has always been against MySQL and sqlite, never had a problem with those.
Thanks for the suggestions!
Added after 7 minutes:
Originally Posted by
ChrisW67
What do QSqlError::serverText(), databaseText(), and number() return?
text(): "��������ï€ï“€ï…€ï”€ïƒ€ï¿½ï¿½ï¿½ï¿½ï€ï¿½ï¿½ï¿½ï¿½ïŽ€ïƒ€ï…€ï”€ï“€ïƒ€ïˆ€ï„€ï¿½ï¿½ï¿½ï¿½ï€ï‚€ï…€ï„€d
driverText(): "QODBC3: Unable to connect"
databaseText(): "��������ï€ï“€ï…€ï”€ïƒ€ï¿½ï¿½ï¿½ï¿½ï€ï¿½ï¿½ï¿½ï¿½ïŽ€ïƒ€ï…€ï”€ï“€ïƒ€ïˆ€ï„€ï¿½ï¿½ï¿½ï¿½ï€ï‚€ï…€ï„€d
number(): 0
drivers(): ("QSQLITE", "QSQLITE3", "QMYSQL3", "QMYSQL", "QODBC3", "QODBC", "QTDS7", "QTDS")
text(): "��������ï€ï“€ï…€ï”€ïƒ€ï¿½ï¿½ï¿½ï¿½ï€ï¿½ï¿½ï¿½ï¿½ïŽ€ïƒ€ï…€ï”€ï“€ïƒ€ïˆ€ï„€ï¿½ï¿½ï¿½ï¿½ï€ï‚€ï…€ï„€d
driverText(): "QODBC3: Unable to connect"
databaseText(): "��������ï€ï“€ï…€ï”€ïƒ€ï¿½ï¿½ï¿½ï¿½ï€ï¿½ï¿½ï¿½ï¿½ïŽ€ïƒ€ï…€ï”€ï“€ïƒ€ïˆ€ï„€ï¿½ï¿½ï¿½ï¿½ï€ï‚€ï…€ï„€d
number(): 0
drivers(): ("QSQLITE", "QSQLITE3", "QMYSQL3", "QMYSQL", "QODBC3", "QODBC", "QTDS7", "QTDS")
To copy to clipboard, switch view to plain text mode
Try removing the host, port, user name and password from the DSN and set them with the corresponding QSqlDatabase calls.
I tried that, and many more things. Thanks for the suggestion though. But I think the problem is related to some obscure ODBC issue here. That output is certainly not normal, and as long as I continue to get corrupted output there, it might be indicative that something is not working well at the data source level.
But then, there's the fact that using tsql, isql et al I can query whatever I want and everything works, so I guess it's the qt-to-odbc layer with is in fault here.
Ugh.
Bookmarks