Page 1 of 2

Hyphen in DB Name

Posted: Tue 09 Jul 2019 12:52
by xnadeem
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

Re: Hyphen in DB Name

Posted: Wed 10 Jul 2019 07:46
by Stellar
Please try to set the UseQuoteChar parameter to True in the connection settings. For example:

SQLConnection1.Params.Values['UseQuoteChar'] := 'True';

Re: Hyphen in DB Name

Posted: Mon 15 Jul 2019 10:41
by xnadeem
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;

Re: Hyphen in DB Name

Posted: Tue 16 Jul 2019 08:59
by Stellar
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.

Re: Hyphen in DB Name

Posted: Tue 16 Jul 2019 09:13
by xnadeem
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

Re: Hyphen in DB Name

Posted: Thu 18 Jul 2019 08:52
by Stellar
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

Posted: Thu 18 Jul 2019 09:03
by xnadeem
Any Idea when this new build will be available Please?

Re: Hyphen in DB Name

Posted: Thu 18 Jul 2019 12:55
by Stellar
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

Posted: Thu 08 Aug 2019 07:10
by xnadeem
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

Re: Hyphen in DB Name

Posted: Thu 08 Aug 2019 13:35
by Stellar
We're planning to release a new version of dbExpress driver for SQL Server next week.

Re: Hyphen in DB Name

Posted: Thu 08 Aug 2019 13:46
by xnadeem
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?

Re: Hyphen in DB Name

Posted: Fri 09 Aug 2019 07:33
by Stellar
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.

Re: Hyphen in DB Name

Posted: Tue 13 Aug 2019 14:27
by samadmahmud
Hi
Do we have a date for the fix to be available?
Thanks

Re: Hyphen in DB Name

Posted: Wed 14 Aug 2019 14:06
by ViktorV
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.

Re: Hyphen in DB Name

Posted: Tue 20 Aug 2019 11:03
by xnadeem
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