odbc_connect(): SQL error: [Sybase][ODBC Driver][SQL Anywhere]Database server not found, SQL state 08001 - vpn

I am on windows 2012 server (PHP version 5.4.29, Apache server) and able to connect to Sybase DB which was running on windows 2008 server by using the below code. Both servers were connected via VPN
$odbc_conn = odbc_connect('Driver={SQL Anywhere 16};DataBase=DBNAME;Server=SERVERNAME;CommLinks=tcpip(Host=ipaddress);','username', 'password');
But the above code is not able to connect to Sybase DB which was running on windows 2012 server. As it is using the same SQL Anywhere version as on the Old windows 2008 server. The only change I did in my above code is the new server name and new IP like below. Remaining DB name and credentials are the same.
$odbc_conn = odbc_connect('Driver={SQL Anywhere 16};DataBase=DBNAME;Server=NEW_SERVERNAME;CommLinks=tcpip(Host=new_ipaddress);','username', 'password');
I am getting the below error.
Warning: odbc_connect(): SQL error: [Sybase][ODBC Driver][SQL Anywhere]Database server not found, SQL state 08001 in SQLConnect
Any help would be greatly appreciated.

Related

Using ODBC package to access SQL Express from R on Mac vs PC

I've been trying to set up a remote SQL Express database to test analysis work I've been doing (the full dataset is a full SQL Server build but for IG purposes I'm trying to do a minimal test setup in-house). I have a copy of the latest version of SQL Express set up on an old PC. My primary development environment is on the Mac, but I've got Bootcamp installed on it.
I installed the MS SQL ODBC driver for Mac from the Microsoft website, and have been trying to use the ODBC package following the instructions on https://db.rstudio.com.
After initial attempts failed, I tested the local setup of the SQL Server, following Microsoft's troubleshooting guide.
I then switched using Bootcamp to Windows, installed RStudio on there, and ran the same line of code (below) with the Windows version of the driver name, with success.
I've disabled the firewall to ensure that this wasn't interfering. I've pinged Test-PC and confirmed that the IP address works as expected. The error I get is as below.
Could anyone suggest where to go / look next?
library(odbc)
> odbc::odbcListDrivers()
name attribute value
1 ODBC Driver 13 for SQL Server Description Microsoft ODBC Driver 13 for SQL Server
2 ODBC Driver 13 for SQL Server Driver /usr/local/lib/libmsodbcsql.13.dylib
3 ODBC Driver 13 for SQL Server UsageCount
> con <- dbConnect(odbc::odbc(), Driver="ODBC Driver 13 for SQL Server", Server = "Test-PC/SQLEXPRESS", UID = "my_user", PWD = "my_password", Port = 1433)
Error: nanodbc/nanodbc.cpp:950: HYT00: [Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired

SSMS is OK but Local IIS Cannot Connect to SQL Server

I'm getting the dreaded "A network-related or instance-specific error" error but only when attempting to connect from my local IIS server. IIS and SQL are both installed on the same machine.
SQL Server (EXPRESS) is running and the SQL Server Browser is also running. Client Protocols (Shared Memory, TCP/IP, and Named Pipes) are all enabled. I can connect and run queries via SSMS both locally and remotely using both Named Pipes and TCP using either Windows Authentication (My Account) or a SQL Server login.
Here is the connection string I am using in my web.config
Server=(local)\SQLEXPRESS;Database=MyDbName;User ID=MyUsername;Password=MyPassword"
Server=(local)\SQLEXPRESS;Database=MyDbName;Integrated Security=True;
Any recommendations are appreciated:
Win Server: 2016
IIS: 10.0.14393
SQL Server Express: 14.0.1
Solved: This was due to an additional connection string only used for Code Migration updates.

Connect to SQL Server with local server user

I have the following construct:
srv-mssql1
Windows Server 2008
Microsoft SQL Server
With a local user: dbuserNT1 (it is added unders Logins as a DB user)
srv-iisweb1
Windows Server 2012
IIS
ASP.Net / C# app running
I want to connect to the SQL Server with the user dbuserNT1 from srv-iisweb1 (through the ASP.Net app).
How do I have to build my connection string to achieve that?
Please note that dbuserNT1 is a local user on srv-mssql1
So I tought I'd need to use the user srv-mssql1\dbuserNT1. But that doesn't work.
Doesn't work trough ssms on my windows 7 machine, but from the srv-mssql1 also with ssms it works trough windows authentication.
When I try to connect from my Windows 7 machine, ssms throws Error: 18456
Thanks in advance

SQLServer 2016 linked server to iseries - catastrophic failure

Environment:
Windows Server 2012 R2 Standard
SQL Server 2016 Developer and SQL SERVER 2008 R2 installed.
Linked Server to iseries DB2 (MSDASQL on 64bit ODBC connection) works fine on SQLServer 2008 R2.
Linked SERVER to same DB2 from SQL Server 2016 instance does not work though the Linked SERVER catalog lists out the tables on iseries.
On running a select query using openquery, query comes out with the following error:
The OLE DB provider "MSDASQL" for linked server "test" reported an error. The provider reported an unexpected catastrophic failure.
Msg 7330, Level 16, State 2, Line 5
Cannot fetch a row from OLE DB provider "MSDASQL" for linked server "test".
Query ouput tab shows all the column names in the table.
We have tried enabling Allow inprocess option on provider MSDASQL, dropping and recreating Linked Server etc.
Can any one help on this error please?

d Oracle connection couldnot open error from asp.net

I have installed oracle express 10 on my localmachine in which all oracle client tools were already installed to connect to a remote oracle server before.After replicating the databses from remote server in the local when I try to connect to the local version or remote version from asp.net it throws an exception telling connection couldnot open.I can use the same connection parameters and connect in SQLdeveloper/toad.When I uninstall oracle express I can connect to remote server again.I am running windows xp 64 bit version.Can someone help me with this?
..installing oracleXE after installing oracle client was the problem.The real issue was in the order of the paths variable

Resources