I'm developing Smart Device application, In that i have set of statement, which establishes connection with sql Server 2000 Database. When ever I try to open SqlConnection, I’m getting error "Can't find PInvoke DLL 'dbnetlib.dll'.". My OS is WINDOWS CE..
Thank You
Related
I'm studying Microsoft COM technology from the book Learning DCOM 1999. I am puzzled with its Hello Universe sample program in Appendex D. The code is available here.
This sample contains a HelloClient.exe and a HelloServer.exe. They can be run on different Windows machines and HelloClient.exe is able to remotely call server's exposed IHello interface.
I tried HelloServer.exe on Windows XP and the HelloClient.exe on Win7 successfully call into the remote object.
However, when HelloServer.exe is run on Windows 7, the remote client always fails on CoCreateInstanceEx(CLSID_Hello, ...) with 0x80040154 (Class not registered).
So I think there must be some change since Windows Vista/7 that causes the failure.
Then what is the change, or, what am I missing?
BTW: I compile the code using Visual Studio 2010 SP1.
I am tyring to create a scanner application and this requires going into my database and fetching a upc code. However I don't know how to accomplish this in visual studio. Essentially when a person clicks a button a database connection should open from the smart device which will allow the user to see the price of an item. However I was struggling trying to create a a database connection so I tried doing it by my odbc driver which is how I use it for my access programs. This worked and I can see all my tables on my server explorer. However I don't know if I have to explicitly establish a connection pragmatically as well in order to run a select statement....
I forgot to mention I decided to go with an ODBC connection because when I tried sing Microsoft Sql Server (SQLCLient) I got an error saying "The server version is not supported only servers up to Microsoft Sql Server 2005 are supported"
So I decided to go with the odbc driver but I don't even know if using an odbc driver will work while using the application on the scanner device
I haven't programming with VS nor vb.net so this is all pretty new to me, so any pointers at all help
My Problem is that I cannot connect to an SQL Server Express 2008 64bit Database via an Access Runtime 32bit, neither by Windows authentification nor by SQL auth.
On the Windows 2011 Small Business Server runs a Virtual machine with Windows 7 Prof. 32 bit. From this Windows I tested my Access App. using a (32bit) SQL Driver 11, which works fine.
The same Access App used from a 64 bit Windows 7 Prof. Client using a 64bit SQL Driver 11 fails with SQLState 08001 error.
The Thing which I do not understand is, that ODBC Connection test is successful, a data link (UDL) is successful, but not my Access App.
When starting the app, the first Thing is to run a stored procedure through a passthrougquery and grab data from a certain tbl in the SQL-Database. This SP brings the Connection error, but not an runtime error from Access (I removed even an error handler!).
So, how can I find the reason or any error in the Access app (if there is one)?
I am helpless as anything I know to test or to do I already tried out to make the app run. As I cannot even install the SQL Driver 11 in 32bit, it should not be a Driver related error.
Does anyone know a test-app, where I cannot only connect but retrieve data from an SQL-Database or any other tricks to check the Access to the database?
Thanks your help!
Access usually is installed as a 32bit Application. So on 64bit computers it will use the 32bit subsystem. On Windows 7 all the default shortcuts to the ODBC Data Source Administrator utility will lead to the 64bit version of it. Whatever you see or configure there is completely irrelevant, as your 32bit Access is not going to see it.
Solution:
You need to explicitely open the 32bit version of the ODBC Admin utility and configure the data source there.
To make sure you get the right version, use Windows Explorer and open this file: C:\WINDOWS\syswow64\odbcad32.exe
Well, what I found out meanwhile is, that the Connection Fails when trying to use a Connection like this "ODBC; DSN=MyDSN;....." but it works, when I make a Connection DNS-less, by connecting with "ODBC;DRIVER=SQL Server Native Client 11; SErver=myServer;....".
Maybe this is exactly that what you are talking aout. When I just use a DSN it takes the wrong bit Version.
So I will try this: delete the DSN I have, open odbcad32.exe and create the same DSN again.
If I understand you correct, then Win 7 provides the correct Driver and stores it in the DSN. Calling this DSN by Access would lead to the correct Settings.
Further Problem is, that my SSQL-Server instance is not at port 1434, and the SQL Server Native Client 11 Driver has no more Clientconfiguartion to set the static port. So I found a string solution for that "MyServer\Myinstance, 15999".
I hope that this port Setting will be accepted in the DSN, otherwise I really have to Change to DSN-less which is more complicated due to different Servers for the development and the production.
Thanks yr. reply.
i am working on vb.net windows application, it included vb6 reporting application exe also,for this application i am using SQL Server,In my working system it is working good. I have installed EXE in client system ,Some times in some systems i am getting this error like :
[Microsoft][ODBC SQL Server Driver][DBNETLIB] Invalid connection
any one please give me the suggestion on what i have to do.
I recently installed SQL Server 2008 Express on my Windows 7 Ultimate x64 home machine. I also have IIS 7.5 with PHP 5.3, and I was trying to connect to SQL via ADODB, but kept getting this error:
[Microsoft][ODBC Driver Manager] The specified DSN contains an
architecture mismatch between the Driver and Application
After doing a small amount of digging on the internet, I think this is because the SQL Server ODBC driver is meant for 32-bit operating systems, and mine's 64. First of all, am I correct? Is this the reason I'm running into trouble? Secondly, if so, how do I fix this? Are there any updated ODBC drivers that work with 64-bit operating systems? I looked but was unable to find any...
You're right in that it has to do with the bits.
Hope this helps:
--From MSDN --
To manage a data source that connects to a 32-bit driver under 64-bit
platform, use c:\windows\sysWOW64\odbcad32.exe. To manage a data
source that connects to a 64-bit driver, use
c:\windows\system32\odbcad32.exe. If you use the 64-bit odbcad32.exe
to configure or remove a DSN that connects to a 32-bit driver you will
receive this message.
I've been having the same problem trying to link a 64 bit SQL 2012 server to 'Sage Timberline' using Pervasive ODBC Client Interface.
I can set up the 32 bit DSN, but SQL Server keeps giving me the "architecture mismatch" error when trying to create a linked server using the 32 bit DSN.
I tried the C:\Windows\SysWOW64\odbcad32.exe to add the driver. But when I set up a linked server between MAS90 and SQL Server 2008 R2 I still get the architecture mismatch error. Just spoke to a guy from Sage and he says it won't work with 64-bit edition of Sql Server. The linked server works with MAS90 only if the edition of Sql Server is 32-bit.
I'm betting you are working with User DSNs.
Depending on your perspective, there's a "feature" or "bug" in the 64-bit Windows environment --
32-bit User DSNs show up in the 64-bit Administrator and when 64-bit client applications ask for all available DSNs -- even though the 32-bit DSNs cannot be used by the 64-bit client app and Adminstrator.
64-bit User DSNs show up in the 32-bit Administrator and when 32-bit client applications ask for all available DSNs -- even though the 64-bit DSNs cannot be used by the 32-bit client app and Adminstrator.
The error message you describe comes up anytime there's such a bitness mismatch between the DSN and the client trying to work with it.
Microsoft's recommendation is to name your User DSNs with _32 or _64, depending on the bitness of the driver on which they're based ... or stick with System DSNs.
There are 32-bit and 64-bit solutions for the connection you want. The bitness of your client application(s) -- IIS & PHP, in this case -- dictate the bitness of the solution you require.
if 32 bit application on 64 bit operating system (the application you are installed under [program files (X86)] use the following
C:\Windows\SysWOW64\odbcad32.exe
otherwise 64 bit application and 64 bit operating system use the following
C:\Windows\System32\odbcad32.exe
otherwise you will get a error like "Architectural mismatch"
Hope this will save someone's day :)
This worked for me:
Updated solution, make sure the IIS application is NOT set to 32-bit on x64 Windows. More info:
http://forum.gpsgate.com/topic.asp?TOPIC_ID=13711
from:
http://forum.gpsgate.com/topic.asp?TOPIC_ID=13622