distal-attribute
distal-attribute
distal-attribute
distal-attribute

error in connecting when password contains semicolon

User, date Message
Written by jenda86
8 months ago
Category: General
3 posts since Tue, 04 Feb 14
Hello.

I am having problems when I try to connect to MSSQL server when password contains semicolon (i.e. abds;abc ) - HeidiSQL doesnt even try to connect and outputs error message: SQL Error(0) - Invalid argument of connection string (I translated this message from my native language, I hope it is right, I couldn't get it in English).

Since the server isn't under my management, but client's, it is not possible to change the pass, thus I cannot connect at all.

You might look into it.
Thanks.
Written by Max
8 months ago
1 posts since Wed, 05 Feb 14
Hey jenda86

i got the same problem when i used heidi sql and the ssl tunnel. The problem is you use an " in your passwort and when plink.exe tried to connect to the server it looks like

plink.exe -P 22 -L 3307:127.0.0.1:3306 -pw "yourPW" root@host.com

so when you have a double quotes in your password plink.exe dont send all the password it will send only to the second double quote.

Example: your"pw

plink.exe will send onli your because the syntax is

plink.exe -P 22 -L 3307:127.0.0.1:3306 -pw "your"PW" root@host.com

try to change the password on the mysql host or open plink.exe manually... like this http://www.heidisql.com/forum.php?t=6561
Written by jenda86
8 months ago
3 posts since Tue, 04 Feb 14
Hello.

Thanks for reply.
However that does not describe my problem.
I am not using SSH tunnel and not MYSQL at all. And I cannot change the password of MSSQL password, since it is server of our client who uses it elsewhere.

And when I try to connect with password where is not semicolon (;) the application at least try to connect. With semicolon it doesnt even try to connect and gives me that error msg.
Written by ansgar
8 months ago
5045 posts since Fri, 07 Apr 06
Passwords are not yet quoted in HeidiSQL's connection string, but they need to be if they contain a semicolon: http://forums.asp.net/t/1957484.aspx?Passwords+ending+with+semi+colon+as+the+terminal+element+in+connection+strings+

I'll change that but I need to test that first.
Written by ansgar
8 months ago
5045 posts since Fri, 07 Apr 06
Done in r4701. Please test and report back.
Written by jenda86
8 months ago
3 posts since Tue, 04 Feb 14
Hello ansgar.

Your fix helped and now Heidi connects without any issues.
Thanks for very quick fix and also for the great app!

Cheers!
Written by kalvaro
8 months ago
601 posts since Thu, 29 Nov 07

// Quote password, just in case there is a semicolon or a double quote in it.
// See http://forums.asp.net/t/1957484.aspx?Passwords+ending+with+semi+colon+as+the+terminal+element+in+connection+strings+
if Pos('"', Parameters.Password) > 0 then
QuotedPassword := ''''+Parameters.Password+''''
else
QuotedPassword := '"'+Parameters.Password+'"';



What happens if the password has double quotes and single quotes?
Written by ansgar
8 months ago
5045 posts since Fri, 07 Apr 06
Yes that's what came into my mind as well. No clue. Microsoft does not say a word about that in their documentation.
Written by ansgar
8 months ago
5045 posts since Fri, 07 Apr 06
Oh, there is a way:

msdoc wrote: If the value contains both single-quote and double-quote characters, the quotation mark character used to enclose the value must be doubled every time it occurs within the value.


Quite much effort for just an escaping issue...
 

Please login to leave a reply, or register at first.