[HowTo] access SQL Server 12.0.5207 on a Windows Server VM
************ only works up-to 1.1.3
for 1.1.4: bug 1789569
**** the solution from comment #6 --- thanks to the provider ***************
The "missing link" was the Microsoft JDBC Driver 7.0 for SQL Server. I downloaded the jar from them here:
https:/
(which directs you to here: https:/
The jar file referenced in my "load" command after the imports.
So far it appears to be working well!
By the way, this is connecting to SQL Server 12.0.5207 on a Windows Server VM.
Thought that I would share it in case someone else needed help with this as well.
Thanks for your help, Raiman!
Ron
-=-=-=-
from com.ziclix.
import datetime
import sys
load("C:
conn = None
d, u, p, v = "jdbc:sqlserver
try:
conn = zxJDBC.connect(d, u, p, v)
cursor = conn.cursor()
cursor.
print cursor.fetchone()
print "DB Name: " + conn.dbname
print "DB Version: " + conn.dbversion
print "Driver Name: " + conn.drivername
print "Driver Version: " + conn.driverversion
print "Database URL: " + str(conn.url)
print "Connection info: " + str(conn.
print "Is connection closed? -> " + str(conn.closed)
conn.close()
except:
exc_type, exc_val, exc_tb = sys.exc_info()
ErrorText = "***** ERROR IN SCRIPTNAME = " + sys.argv[0] + " *****\n"
ErrorText += "Date/Time : " + str(datetime.
ErrorText += "Line Number: " + str(exc_
ErrorText += "Error Type : " + exc_type.__name__ + "\n"
ErrorText += "Error Value: " + exc_val.message + "\n"
ErrorText += "******
print ErrorText
-------
I am running Windows 7.
I have SIkuliX 1.1.2 installed.
I have Python 2.7 installed (C:\Python27)
I have installed pyodbc via pip.
I added a "sites.txt" file per instructions in found in the "Answers" forum.
The file is located under my AppData folder here:
C:\Users\
The sites.txt file contains only the following line:
C:\Python27\
I placed the line "import pyodbc" in my script, but when I run it I receive a traceback error that states:
"ImportError: No module named pyodbc"
I thought that perhaps the pyodbc driver wasn't properly installed, so I tried running the pip again, but it reported:
"Requirement already satisfied: pyodbc in c:\python27\
I'm obviously doing something wrong. Please let me know how I can get this working.
Thanks in advance!
Ron
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Ron Turrentine
- Solved:
- Last query:
- Last reply: