Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQLStringConnect() - working as .app, not as .exe
Message
From
04/07/2009 15:10:54
 
 
To
04/07/2009 14:47:54
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01410028
Message ID:
01410087
Views:
52
Why is it running the unicode verison of the function?

Does this help:
If the application is compiled with the _UNICODE #define, the ODBC header file will map undecorated function calls (SQLDriverConnect) to the Unicode version (SQLDriverConnectW.)

The Driver Manager recognizes a driver as a Unicode driver if SQLConnectW is supported by the driver.

If the driver is a Unicode driver, the Driver Manager makes function calls as follows:

Passes a function without string arguments or parameters directly through to the driver.

Passes Unicode functions (with the W suffix) directly through to the driver.

Converts an ANSI function (with the A suffix) to a Unicode function (with the W suffix) by converting the string arguments into Unicode characters and passes the Unicode function to the driver.

If the driver is an ANSI driver, the Driver Manager makes function calls as follows:

Passes functions without string arguments or parameters directly through to the driver.

Converts Unicode functions (with the W suffix) to an ANSI function call and passes it to the driver.

Passes an ANSI function directly to the driver.


http://msdn.microsoft.com/en-us/library/ms716540(VS.85).aspx


>>>According to AError(), the connection attempt is timing out, which I suspected intuitively. The connection string looks correct, and when I switch back to compiling the application as an .app, it continues to work correctly. Most of the research I've done indicates that there's something going on at the server end, but that doesn't make sense in the context.
>>>
>>>Any thoughts?
>>
>>Are you sure that connection string is exactly the same in both cases?
>
>Yes - I've verified that the connection string is both the same and correct.
>
>I ran the application .exe inside VFP and it works correctly.The most recent time I ran the .exe independently, I used ODBC tracing, and got a SQL.LOG file that included the following:
>
>
>2108            1654-b20	ENTER SQLDriverConnectW 
>		HDBC                0098BD68
>		HWND                00000000
>		WCHAR *             0x6FD6B1C0 [      -3] <Invalid string length!>
>		SWORD                       -3 
>		WCHAR *             0x6FD6B1C0 
>		SWORD                       -3 
>		SWORD *             0x00000000
>		UWORD                        0 <SQL_DRIVER_NOPROMPT>
>
>2108            1654-b20	EXIT  SQLDriverConnectW  with return code -1 (SQL_ERROR)
>		HDBC                0098BD68
>		HWND                00000000
>		WCHAR *             0x6FD6B1C0 [      -3] <Invalid string length!>
>		SWORD                       -3 
>		WCHAR *             0x6FD6B1C0 
>		SWORD                       -3 
>		SWORD *             0x00000000
>		UWORD                        0 <SQL_DRIVER_NOPROMPT>
>
>
>(2108.exe is the name of the application.)
>
>Anyone know how to read this, and if so, what does it mean?
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform