I am not able to connect to tally odbc from another network. I have whitelisted my IP and Opened port 9000. Tally is installed on a machine in cloud. Here is what I am doing:
import pyodbc
conn = pyodbc.connect('Dsn=TallyODBC64_9000;Driver={Tally ODBC Driver};server=20.xx.xx.xx;port=9000')
It is giving me this error:
InterfaceError: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)')
I have looked on the internet but couldn't find anything on connecting outside of your network.
Questions:
Do I need to install Tally ODBC Driver on my machine?
Can you guide me on where I am going wrong.
Thanks.
Try Accessing your server in browser http://20.xx.xx.xx:9000
if it shows <RESPONSE>TallyPrime Server is Running</RESPONSE>
then try connecting using ODBC
if its shows nothing, then you need to check whether Port configured in Tally is allowed in Cloud security setting and system firewall settings
Related
I am getting a strange error with Python condo environments and PyODBC. I have multiple Conda environments, I am able to connect from one of the environment (from a Linux machine) to SQL Server hosted on Azure but not from the other one. Both Python environments have version 3.7.7 of Python and version 4.0.0 of Pyodbc. Code is exactly the same and connection string uses SQL Server 17 driver.
conn_str='DRIVER={ODBC Driver 17 for SQL Server};SERVER=' +server+';Authentication=ActiveDirectoryPassword;DATABASE='+database+';UID='+self.user_name+';PWD='+self.password
Error is :
pyodbc.OperationalError: ('HYT00', '[HYT00] [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (0) (SQLDriverConnect)')
As you can see above, the issue might be DNS-related. In the
connection string, try using an IP address instead of the hostname,
or check your DNS setup.
Try downgrade to ODBC driver 13 and have a try. For that version 17
needs to be uninstalled.
Try using connect from SQL Authentication instead of Active Directory
Password.
The SQL Server ODBC drivers for Linux from Microsoft are unable to determine instance names.
I had written code to connect to a DB2 server using Python that was working fine until my company had me upgrade the IBM DB2 Driver to 11.5. Now, its no longer working and I'm getting the following error message:
SQLCODE=-30082n: [IBM][CLI Driver] SQL30082N Security processing failed with reason "15" ("PROCESSING FAILURE"). SQLSTATE=08001
I verified that I have the right password. Also, I confirmed that I still have access to the Database by going through the ODBC Manager in Windows and testing a connection that way. I've checked several pages here on Stackoverflow and other sites and nothing seems to work. Most of the issues people are having on this site involve different error messages.
Here is the original code using the ibm_db module:
import ibm_db
import ibm_db_dbi
con = ibm_db_dbi.Connection(ibm_db.connect("ABC1011","rsmith","Passw123"))
When that stopped working i tried connecting using pyodbc as a connection:
import pyodbc
cnxn = pyodbc.connect('DRIVER={IBM DB2 ODBC DRIVER - DB2COPY2};Database=ABC1011;UID=rsmith; PWD=Passw123')
Again, I already verified in the ODBC Datasource Administrator (64-bit) that I am using the correct password, I have the correct database, and that I am using the correct driver's name. Does anyone know what else I may need to include to get a connection to work?
Thank you.
I am having issues connecting to an Azure database from a Virtual Machine running Ubuntu 16.04. This VM is in Google cloud. I get the following error
pypyodbc.Error: (u'IM002', u'[IM002] [unixODBC][Driver Manager]Data source
name
not found, and no default driver specified')
This code works fine locally on my PC in a Jupyter notebook. I have added the Google Cloud VM's IP address to the let it through the Azure firewall- so that doesn't appear to be the cause of the error. I have observed that I can replicate the original error message in Jupyter notebook if I change the driver "SQL Server Native Client" from 11.0 to 13.0
This all points to driver issues. A similar issue has been discussed here
With the problem being linked to "not defining that driver in the "/etc/odbcinst.ini" file."
My odbcinst.ini file contains the following information:
[ODBC Driver 13 for SQL Server]
Description=Microsoft ODBC Driver 13 for SQL Server
Driver=/opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.1.so.8.0
UsageCount=1
My odbc.ini file contains no information.
If I change my connection string in my code to "Driver={SQL Server Native Client 13.0" I get the same error. My other thought was to run with a version 11 of the driver. However there doesn't appear to be one for Ubuntu (only SUSE & RedHat Linux).I am new to this subject area- so feeling stuck. Any suggestions on a next logical step to resolve the connection issue.
Regards
Mike
I host a web app on Windows Azure (Flask), which runs on Windows Server.
I have a linux development environment (some other contributors may use windows in the future), so we use pyodbc to communicate with the SQL Server. Unfortunately, I have to change my connection string every time I pull or push from the Azure deployment due to linux and windows ODBC connection differences.
Consider my connection string:
pyodbc.connect('Driver=SQL
Server;Server=tcp:mydbname.database.windows.net,1433;Database=mydbname;Uid=dbuser#mydbname;Pwd=topsecret;Encrypt=yes;TrustServerCertificate=no;Connection
Timeout=30;')
This works fine once it's deployed on the server (Windows Server), or on the windows box, but doesn't work on the linux dev box. I found some over SO questions and a guide on how to setup FreeTDS (e.g. Connecting to Microsoft SQL Server through pyODBC on Ubuntu and http://www.gazoakley.com/content/connecting-sql-azure-python-ubuntu-using-freetds-and-unixodbc, http://blog.tryolabs.com/2012/06/25/connecting-sql-server-database-python-under-ubuntu/).
However, after following those guides through you have to remove the server name and replace it with a the DSN (data source name), which is a locally configured variable. While that will work on a local linux box, that doesn't work once it's deployed to the Azure web server (windows).
pyodbc.connect('DSN=SQL Server;Driver=SQL
Server;Database=mydbname;Uid=dbuser#mydbname;Pwd=topsecret;Encrypt=yes;TrustServerCertificate=no;Connection
Timeout=30;')
You have to remove the servername otherwise it conflicts with the odbc/FreeTDS config.
With no DNS specified (first connection string in this post):
pyodbc.Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source
name not found, and no default driver specified (0) (SQLDriverConnect)
With DNS and servername:
pyodbc.Error: ('HY000', '[HY000] [unixODBC][FreeTDS][SQL Server]Only
one between SERVER, SERVERNAME and DSN can be specified (0)
(SQLDriverConnect)')
With DNS and no server name
When deployed to the server it wont work.
We use git for version control, and I don't want to have continuous merge conflicts as developers change their connection string to match their dev enviroments and/or deploy to the Azure site.
Is there a clean fix for this. Gut tells me I'm doing something wrong, and this is very trivial.
First of all, if you have successfully connected to SQL Server both in Windows and Linux platforms, congratulations. In python, there is a package installed by python default named ‘platform’, we can use it to check the what platform python script run in. And we can set 2 connection string in advance, and select the specific string in different platform.
Here is my python code snippet:
import platform
def getOBCDString():
stsos = platform.system()
bol = False
odbcstring=''
if(stsos == "Windows"):
bol = True
odbcstring = 'windows_odbc_string'
elif(stsos == "Linux"):
bol = True
odbcstring = 'Linux_odbc_string'
#else:
# custom error handle
return (bol,odbcstring)
bol,string = getOBCDString()
if(bol):
print(string)
Is it possible connect using local Domain credentials that I use to log into my OSX System to connect to a SQLServer DB with python, pyodbc, unixodbc, and FreeTDS like I would when connecting from a Windows system?
Windows Connection String that works:
pyodbc.connect('Trusted_Connection=yes', driver='FreeTDS', TDS_Version = 7.0, server='<SERVER>', port=<PORT>, database='<DATABASE>')
When I attempt this from a Mac I get the following error:
pyodbc.Error: ('08001', '[08001] [unixODBC][FreeTDS][SQL Server]Unable to connect to data source (0) (SQLDriverConnect)')
I am attempting to avoid hard coding usernames and passwords.
The Trusted_Connection setting indicates whether to use Windows Authentication Mode for login validation or not. Given that you're using a Mac, I suspect that Windows Authentication Mode will not be possible and so it will be necessary to pass the username and password to the connection string.