MsSQL FreeTDS With Azure Connect
-
- Fresh Boarder
- Posts: 6
- Joined: 21.04.2013, 18:21
MsSQL FreeTDS With Azure Connect
I use a dbLib to conect with SQL server and FreeTDS_MsSQL-7.0. This is working so far.
But when I connect to azure i get the follow error:
DBError : [40508] : General SQL Server error: Check messages from the SQL Server
USE statement is not supported to switch between databases. Use a new connection to connect to a different database.
In microsoft I found https://msdn.microsoft.com/en-us/librar ... 36282.aspx
Transact-SQL statements
The Transact-SQL USE command is not currently supported for switching between databases. Establish a connection directly to the target database.
in ZDBCDbLib i Found
procedure TZDBLibConnection.Open;
var
LogMessage: RawByteString;
begin
if not Closed then
Exit;
InternalLogin;
LogMessage := 'USE '+ ConSettings^.Database;
---
How I can conect to azure database ?
But when I connect to azure i get the follow error:
DBError : [40508] : General SQL Server error: Check messages from the SQL Server
USE statement is not supported to switch between databases. Use a new connection to connect to a different database.
In microsoft I found https://msdn.microsoft.com/en-us/librar ... 36282.aspx
Transact-SQL statements
The Transact-SQL USE command is not currently supported for switching between databases. Establish a connection directly to the target database.
in ZDBCDbLib i Found
procedure TZDBLibConnection.Open;
var
LogMessage: RawByteString;
begin
if not Closed then
Exit;
InternalLogin;
LogMessage := 'USE '+ ConSettings^.Database;
---
How I can conect to azure database ?
Re: MsSQL FreeTDS With Azure Connect
Same here.
Does any one have connected on a SQL Server Azure Database with Zeos?
Thanks.
Does any one have connected on a SQL Server Azure Database with Zeos?
Thanks.
Re: MsSQL FreeTDS With Azure Connect
Same here.
Does any one have connected on a SQL Server Azure Database with Zeos?
Thanks.
Does any one have connected on a SQL Server Azure Database with Zeos?
Thanks.
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: MsSQL FreeTDS With Azure Connect
Your best bet probably is to use Zeos 8.0 and OleDB. With FreeTDS somebody has to look into getting this to work. Unfortunately I don't have an Azure Database to test against.
The error probably is generated by the calls to dbuse in the dblib driver.
The error probably is generated by the calls to dbuse in the dblib driver.
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: MsSQL FreeTDS With Azure Connect
Note: Our current use of the freetds library most probably will not allow connecting to Azure SQL. For this to work we will have to set the database name in the LOGINREC structure. FreeTDS introduced the DBSETLDBNAME macro for this purpose. I created a feature request to track this:
https://sourceforge.net/p/zeoslib/internaltickets/29/
https://sourceforge.net/p/zeoslib/internaltickets/29/
Re: MsSQL FreeTDS With Azure Connect
Hi.
Thank you for your support.
I've just tried to connect with Zeos 8.0 beta using OleDB but I guess that I couldn't setup the component to perform this connection. First of all I downloaded the driver at https://docs.microsoft.com/pt-br/sql/co ... rver-ver15 . Afer that, when I go to ODBC Data Sources on Windows I cant see the installed driver. Do you have a any tutorial to do this? I don't know too what I can fill in Protocol and HostName properties in ZConnection?
Thanks.
Thank you for your support.
I've just tried to connect with Zeos 8.0 beta using OleDB but I guess that I couldn't setup the component to perform this connection. First of all I downloaded the driver at https://docs.microsoft.com/pt-br/sql/co ... rver-ver15 . Afer that, when I go to ODBC Data Sources on Windows I cant see the installed driver. Do you have a any tutorial to do this? I don't know too what I can fill in Protocol and HostName properties in ZConnection?
Thanks.
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: MsSQL FreeTDS With Azure Connect
OleDB isn't ODBC. You will have to create a connection string for using OleDB. That connection string goes into the database property of TZConnection.
Could you please try what happens when you click on the small button with the "..." right next to the Database property? If all is well, a window should open that helps you in building the connection string. If it doesn't, choose ADO as the protocol. Click on "..." to build and test the connection string. Then use that connection string with OleDB.
Could you please try what happens when you click on the small button with the "..." right next to the Database property? If all is well, a window should open that helps you in building the connection string. If it doesn't, choose ADO as the protocol. Click on "..." to build and test the connection string. Then use that connection string with OleDB.
Re: MsSQL FreeTDS With Azure Connect
Could you help me?
This error appears to me when I changed Connected propertyd to True:
When I configure OLE DB via "..." on Database property the connection test works fine.
If I use "ado" on Protocol property using an OLE DB Datasource it appears to work OK!
This error appears to me when I changed Connected propertyd to True:
Code: Select all
Project Project1.exe raised exception class EZSQLException with message 'SQL Error: OLEDB Error
SQLState: 28000 Native Error: 0
Error message: Especificação de autorização inválida
Source: Microsoft OLE DB Provider for SQL Server
SQLServer details:
Code: 0 Message: IID_IDBInitialize.Initialize'.
If I use "ado" on Protocol property using an OLE DB Datasource it appears to work OK!
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: MsSQL FreeTDS With Azure Connect
Hello,
I am sorry - I cannot help with that. I don't have access to an Azure database. If it works with ADO I suggest to keep using that for now.
Maybe it has to do with storing - or not storing user credentials in the connection string?
Best regards,
Jan
I am sorry - I cannot help with that. I don't have access to an Azure database. If it works with ADO I suggest to keep using that for now.
Maybe it has to do with storing - or not storing user credentials in the connection string?
Best regards,
Jan
Re: MsSQL FreeTDS With Azure Connect
I'm just storing the credentials in the connnection string. If you want you can create an Azure SQL Server Database for 12 months for free (https://azure.microsoft.com/en-us/free/sql-database/) or I can share my database credentials with you.
Thanks.
Thanks.