Hyphen in DB Name
Hyphen in DB Name
Hi,
I am facing an issue where I am trying to execute a stored procedure with no parameters and the Database name has got a hyphen in it. The Stored procedure does not execute and there is an SQL exception complaining about invalid character "-" in the query
Drilling down the DevArt code I have seen that the issue is in function "GetSqlForSysProcedureParameters"
The query thats being fired is trying to get the parameters but having DB name with hyphen and hence its failing. I am guessing it should simply amend the db name by adding "[" and "]"
Can this issue be looked at please
I am facing an issue where I am trying to execute a stored procedure with no parameters and the Database name has got a hyphen in it. The Stored procedure does not execute and there is an SQL exception complaining about invalid character "-" in the query
Drilling down the DevArt code I have seen that the issue is in function "GetSqlForSysProcedureParameters"
The query thats being fired is trying to get the parameters but having DB name with hyphen and hence its failing. I am guessing it should simply amend the db name by adding "[" and "]"
Can this issue be looked at please
Re: Hyphen in DB Name
Please try to set the UseQuoteChar parameter to True in the connection settings. For example:
SQLConnection1.Params.Values['UseQuoteChar'] := 'True';
SQLConnection1.Params.Values['UseQuoteChar'] := 'True';
Re: Hyphen in DB Name
Hi,
I am using below code. As recommended setting 'UseQuoteChar' to true didn't work. The issue is the same as described in original post function "GetSqlForSysProcedureParameters" has the SQL query which throws SQL exception as DB is passed with a hyphen.
So If DB name is "N-CFG" it creates parameters as "N-CFG.dbo" which is incorrect. It should provided as [N-CFG].dbo
Please let me know if there is a workaround for this
Cheers
SQLDB := TSQLConnection.Create(nil);
SQLDB.LoginPrompt := False;
SQLDB.ConnectionName := 'MSSQLConnection';
SQLDB.DriverName := 'DevartSQLServer';
SQLDB.GetDriverFunc := 'getSQLDriverSQLServer';
SQLDB.LibraryName := 'dbexpsda40.dll';
SQLDB.VendorLib := 'sqlncli11';
SQLDB.Params.Values['UseQuoteChar'] := 'True';
SQLDB.Params.Values['Database'] := dbname;
SQLDB.Params.Values['User_name'] := username;
SQLDB.Params.Values['Password'] := password;
SQLDB.Params.Values['Hostname'] := hostname;
I am using below code. As recommended setting 'UseQuoteChar' to true didn't work. The issue is the same as described in original post function "GetSqlForSysProcedureParameters" has the SQL query which throws SQL exception as DB is passed with a hyphen.
So If DB name is "N-CFG" it creates parameters as "N-CFG.dbo" which is incorrect. It should provided as [N-CFG].dbo
Please let me know if there is a workaround for this
Cheers
SQLDB := TSQLConnection.Create(nil);
SQLDB.LoginPrompt := False;
SQLDB.ConnectionName := 'MSSQLConnection';
SQLDB.DriverName := 'DevartSQLServer';
SQLDB.GetDriverFunc := 'getSQLDriverSQLServer';
SQLDB.LibraryName := 'dbexpsda40.dll';
SQLDB.VendorLib := 'sqlncli11';
SQLDB.Params.Values['UseQuoteChar'] := 'True';
SQLDB.Params.Values['Database'] := dbname;
SQLDB.Params.Values['User_name'] := username;
SQLDB.Params.Values['Password'] := password;
SQLDB.Params.Values['Hostname'] := hostname;
Last edited by xnadeem on Tue 16 Jul 2019 09:11, edited 1 time in total.
Re: Hyphen in DB Name
Unfortunately, we can't reproduce the issue. To investigate this behavior of dbExpress driver for SQL Server, please compose a small sample demonstrating the issue and send it to us, including database object creation scripts.
You can send the sample by using the contact form at our site: devart.com/company/contactform.html
Also, please specify the version of dbExpress driver for SQL Server you are using.
You can send the sample by using the contact form at our site: devart.com/company/contactform.html
Also, please specify the version of dbExpress driver for SQL Server you are using.
Re: Hyphen in DB Name
Hi,
to reproducer this you need to have a stored procedure with no parameters and DB name should have hyphen. Only then executing this stored procedure will recreate the issue. I hope you are doing the same
Cheers
Also will be providing you the code in question
to reproducer this you need to have a stored procedure with no parameters and DB name should have hyphen. Only then executing this stored procedure will recreate the issue. I hope you are doing the same
Cheers
Also will be providing you the code in question
Re: Hyphen in DB Name
Thank you for the information. We have fixed the issue, and the fix will be included in the next dbExpress driver for SQL Server build.
Re: Hyphen in DB Name
Any Idea when this new build will be available Please?
Re: Hyphen in DB Name
We can provide you with a nightly build of dbExpress driver for SQL Server Trial Edition with the latest fixes. Please send us a corresponding request via the e-support form on our website (devart.com the "Support"\"Request Support" menu)
Re: Hyphen in DB Name
Hi,
We have got the nightly build and it seems to be working fine. Please can you let us know when can we have official release for this fix? We have customer waiting for this fix
Regards
We have got the nightly build and it seems to be working fine. Please can you let us know when can we have official release for this fix? We have customer waiting for this fix
Regards
Re: Hyphen in DB Name
We're planning to release a new version of dbExpress driver for SQL Server next week.
Re: Hyphen in DB Name
Hi,
Thanks for the reply. Please let us know what is the process of getting the update? Do we have to renew the subscription to get the update?
Thanks for the reply. Please let us know what is the process of getting the update? Do we have to renew the subscription to get the update?
Re: Hyphen in DB Name
During the subscription period (it is active for one year after the product purchase or its renewal), you have access to the latest versions of the product and all bug fixes. Technical support of the product is provided regardless of the subscription term, but you can have access to the latest versions, including the latest fixes, only with an active subscription.
-
- Posts: 2
- Joined: Tue 13 Aug 2019 14:23
Re: Hyphen in DB Name
Hi
Do we have a date for the fix to be available?
Thanks
Do we have a date for the fix to be available?
Thanks
Re: Hyphen in DB Name
The new build of dbExpress driver for SQL Server 8.0.1 that includes the fix is already available for download.
Please check the operation of this build and let us know the result.
Please check the operation of this build and let us know the result.
Re: Hyphen in DB Name
HI,
Thanks for the fix, However I am facing an issue compiling the dll source.
The provided Make.bat residing in Delphi12 folder is not able to compile the dbexpsda40.dpr and is generating following error:
..\TdsUtils.pas(288) Fatal: F1026 File not found: 'CRHttp.dcu'
I have tried looking for this dcu/pas file in the source folders but I am unable to locate. Is there something am missing?
Cheers
Thanks for the fix, However I am facing an issue compiling the dll source.
The provided Make.bat residing in Delphi12 folder is not able to compile the dbexpsda40.dpr and is generating following error:
..\TdsUtils.pas(288) Fatal: F1026 File not found: 'CRHttp.dcu'
I have tried looking for this dcu/pas file in the source folders but I am unable to locate. Is there something am missing?
Cheers