Click here to Skip to main content
15,881,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have MFC application, how can I set
clienthostname as [NULL]
. I tried below code, now working.

I used clienthostname="\0" in my connection string, it does not set value as NULL in database using sybase 16 SP3 driver.

However when i use sybase 15.5 driver, it does set value to NULL for hostname.


What I have tried:

had tried couple of solutions mentioned on net . nothing working. sybase driver 16 SP3 seems to have different behavior.
Posted
Updated 27-Aug-19 4:54am
Comments
Richard MacCutchan 27-Aug-19 4:47am    
That looks like a sybase problem; try their support forum.
Aravhere 27-Aug-19 4:57am    
Initially,I had same thought but want to know if theer is any way to set clienthostname as NULL in MFC using sybase driver 16 SP3.
Richard MacCutchan 27-Aug-19 5:13am    
Your code statement .clienthostname="\0" sets the variable to a pointer to an empty string. If you want it to be NULL, then use NULL, or nullptr.
But you need to check the sybase documentation to see if that is valid.

1 solution

Maybe you're going about it wrong.

Quote:
The set command includes options that allow you to assign each client an individual name, host name, and application name. This is useful for differentiating among clients in a system where many clients connect to Adaptive Server using the same name, host name, or application name.

The partial syntax for the set command is:

set [clientname client_name | clienthostname host_name | clientapplname application_name]



http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.dc36271_1251/html/blocks/X26384.htm[^]
 
Share this answer
 
Comments
Maciej Los 27-Aug-19 10:58am    
Gerry, it's not about sql query. It's about connection string options ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900