QODBC driver not loaded
-
Ok, I assume that you inserted your own values for <DSN>, <USERNAME> and <PASSWORD> and not simply entered
@
osql -D QtODBCDSN -U qtodbclogin -P passw0rd
@If you use
@
C:\Windows\SysWOW64\odbcad32.exe
@again and look into your configured DSN, can you connect to your database from within the Gui (ODBC Data Source Administrator)?
Have you got "Sql Server Configuration Manager" on our machine? The link in the startmenu goes like "C:\Windows\SysWOW64\mmc.exe /32 C:\Windows\SysWOW64\SQLServerManager10.msc"
In the left pane there is a menu entry "Sql Server Network Configuration", open that up, click the instance name you're using and make sure that "Named Pipes" is disabled and "TCP/IP" is enabled. That often leads to "I can not connect to server...".
-
i disabled the Named Pipes it was enable and TCP/IP was enable to and in
C:\Windows\SysWOW64\odbc32.exe my dsn name that i created before is mydsn32 but in authenticity i selected with windows NT authentication using the network login id so i dont need the password and user name then in cmd what should i use for -U and -P? -
Omit -U and -P, use -E instead [-E = trusted connection].
@
C:\Users\username>osql -?
Microsoft (R) SQL Server Command Line Tool
Version 10.50.1600.1 NT x64
Copyright (c) Microsoft Corporation. All rights reserved.Note: osql does not support all features of SQL Server 2008 R2.
Use sqlcmd instead. See SQL Server Books Online for details.usage: osql [-U login id] [-P password]
[-S server] [-H hostname] [-E trusted connection]
[-d use database name] [-l login timeout] [-t query timeout]
[-h headers] [-s colseparator] [-w columnwidth]
[-a packetsize] [-e echo input] [-I Enable Quoted Identifiers]
[-L list servers] [-c cmdend] [-D ODBC DSN name]
[-q "cmdline query"] [-Q "cmdline query" and exit]
[-n remove numbering] [-m errorlevel]
[-r msgs to stderr] [-V severitylevel]
[-i inputfile] [-o outputfile]
[-p print statistics] [-b On error batch abort]
[-X[1] disable commands [and exit with warning]]
[-O use Old ISQL behavior disables the following]
<EOF> batch processing
Auto console width scaling
Wide messages
default errorlevel is -1 vs 1
[-? show syntax summary]
@ -
"First hit on Google":http://msdn.microsoft.com/en-us/library/windows/desktop/ms712362(v=vs.85).aspx
I quote
bq. To resolve this error, use the 32-bit odbcad32.exe to configure or remove the DSN.
-
And you can confirm that you compile a 32 bit program?
-
For the moment I am running out of ideas, sorry.