Can't Connect to DelphiXE5 AND SQL SERVER 2012 - delphi

I have a Delphi application that is connected to SQL Server 2012. On my local, I've been able to connect successfully. I've also tried it on another VM, and it work fine. I deployed it on a Server, and it won't connect to the database. I check the connection string; it looks fine. I am not sure what I am doing wrong here.
SQL Server 2012 is installed on a different server
I can reached the server
I check the provider and it's using SQLNCI11
I have SQL Server 2012 Natice Client Install
I check and make sure that the username/password have access to the database, and they can login
What am I missing here?

Despite the fact that you can change the vendor lib in the provider, that change will have no effect as the name of the DLL is hard-coded into the provider. It will try to use sqlncli10.dll, no matter what the property is.
Install sqlncli10.dll and it should work.

Related

TFS 2012: URL not reachable

after a servercrash we installed TFS on a new server. I used Application Tier only for
restoring the databases, and in the Team Foundation Express Administration Console everything shows up.
When on the server I surf to the URL I get a Windows login screen and after entering credentials it proceeds to the website.
However, if I try this from an PC, the URL is not reachable.
I've checked the firewall (even disabled it for test), put port 8080 is added.
I gues something is wrong with the authentication, hence the Windows login screen, but fail to find.
Anyone ideas?
I use TFS Express 2012.4 on Server 2019
Since you are able to access http://localhost:8080/tfs url and work properly.
This tell you TFS is up and running. So issue should not related to IIS side.
Try to disable loopback by creating registry key under the
location
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\DisableLoopbackCheck
and assigned the value “1”.
Details follow this blog.
If you do not want to disable your firewall during daily usage. Make sure Port 8080 is open in Windows firewall.
Also take a look at this similar issue: TFS url with server name is not working

Unable to access SQL table from appl running as service

I have a small test application, made with Delphi 10.3.1 as an Stand Alone HTTPSYS Intraweb service. It has an ADOConnection and a ADOTable and in FormShow of unit1, I open the connection, and the table and reads the first 10 rows and add them to a listbox. Just to see that it works and is possible.
When running the application as a Stand Alone HTTPSYS, vith visual GUI, it's working nicely, but when I compile it as a service, and install it, on the sql server, or on the development machine, it fails with access Violation, trying to open the table. I suppose it is an Authentication problem.
I have tried to open connection with both Windows Auth, and with a specific SQL login, and I have tried running the service with both local system (default) and with the specific SQL account.
What am I missing ?
The Specific SQL login, works in SSMS. I'm able to use it to login and access my tables.
Also, if I create the application as a DLL and put it on my IIS10, it works fine.
You are right. It has nothing to do with authentication.
For the IntraWeb HttpSys Stand Alone program to run as a service, the ServerController.ComInitialization property must be set to ciMultiThreaded.
Thanks for your comment which lead me to look elsewhere. You do deserve the credit.
Regards
Soren

Umbraco cannot start. A connection string is configured but the Umbraco cannot connect to the database

I'm using Umbraco CMS v7.4 with SQL Server 2014, the project was working fine until a few hours ago, when an error started showing up:
Umbraco cannot start. A connection string is configured but the Umbraco cannot connect to the database
The error occurs when I tried to open the website, see the image below:
I tried the following:
Checked to see if SQL Server is running
Checked the connection string credentials in web.config
Any help is appreciated.
After a few tries, even I loaded the backed up DB, I found that it caused by the DB login, the user in the connection string was having a password expiration enabled (the password had expired).
So, this is what I did:
Open the SQL server
Logged in as the user used in the connection string
Created a new password
Updated the web.config connection string "Password"
Hope this will help
So, in my case I tried to get started with the existing project. I got all the files, restored DB backup locally, made sure all permissions are set for IIS AppPool user etc. But I kept getting the error in question. It turns out that I cannot use server=localhost;database=... in connection string. After I replaced it with server=.\;database=..., it started to work right away.
Also note that if you're running it in Azure with an Azure SQL database you'll have to go to the Azure SQL Server settings and under "Firewalls and virtual networks" you'll need to tick "Yes" for "Allow Azure services and resources to access this server".
I was getting this error when running an Umbraco project locally, with the DB pointing to an instance on Azure. In that case, this problem happens if you haven't allowed the IP access within the Server Firewall of the DB in Azure.
You can fix this by finding out your IP and then adding it to the DB:
Click All Resources within your Azure portal, then click on the SQL Database your project points to.
Click Set Server Firewall on the right-side window.
Add in your IP as the start and end points, and call it something memorable.
Click Save and once you get the confirmation message that It has been applied, refresh your site locally.
I experienced the same problem and here is how I fixed it.
Right-click on your localhost in SSMS and select Properties
Got to the Security page and select "Select authentication" as "SQL Server and Windows Authentication mode"
Hit OK.
Go to Services and find your SQL Server service and restart it.
Check your local umbraco website now, you should be able to see it without any issues. If you still have problems, then you might need to check your local setup and permissions.
Further details are below and on this blog post.

how to connect UNC-located database to embedded server?

I have next specific situation. I have an application using Firebird embedded server. The files: application executive, database, fbembed.dll are located in the same folder. Everything is good and working good.
Now my client says so:
I would like to place all your application file on a server and run it via local network from all workstations.
So as I see I start application on the server and it starts. But database connection string looks now like:
//SERVER/share/db.fdb
Yes, I know conventions about allowed firebird paths from here: FAQ: What's a connection string?
I do not understand what should I use with embedded server? Is it possible at all?
If you want to access a Firebird database over the network, then you need to install Firebird server and connect through the server. You can't (at least not by default) access a database from a network path, and you really shouldn't (although there is a config option to allow it), as it can lead to database corruption due to insufficient or incorrect filelocking support over the network.
So: Don't use Firebird embedded, but install Firebird server and configure the clients to connect to Firebird server.

SQL Server 2008 OLE DB CONNECTION FAILS FROM OUTSIDE

I have a working SQL Server 2008 R2 Express installed on a Windows 2008 server on a cloud machine. All type of connections (ado.net, nhibernate etc.) from several client applications works fine except the OLEDB one. SQL Native Client also works fine.
When I tried to connect from the server locally and as a data source write the instance name, everything was OK. But from outside, I had the problem or also if I write wan ip or dns I had the problem also from local.
-- works perfect from everywhere
Provider=SQLNCLI10;Data Source=mntek.no-ip.org;User ID=xxx;Password=xxx;
-- does not work from anywhere
Provider=SQLOLEDB.1;Data Source=mntek.no-ip.org;User ID=xxx;Password=xxx;
-- works only from local
Provider=SQLOLEDB.1;Data Source=flz001\sqlexpress;User ID=xxx;Password=xxx;
Error: [DBNETLIB][ConnectionOpen (Invalid Instance()).Invalid
connection.
-- works perfect with ado.net
Data Source=mntek.no-ip.org;User ID=xxx;Password=xxx
Some other client applications (not mine) was written with oledb connection so I need them to connect the db with oledb provider.
Any ideas?
Regards,
Mert
It has been a while since this was asked, but I am currently working through an issue related to OLE DB and SQL Server that sounds possibly related.
I found that, even though the server was using the default port (1433), I still had to explicitly specify it in the UDL connection string like this:
Provider=SQLOLEDB.1;User ID=USER;Data Source=IP,1433
I've asked why that might be necessary here:
Why might SQL Server 2008 OLE DB UDL require port 1433 explicitly specified?
Maybe try that and see if it helps.

Resources