473,394 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

trouble with mxODBC, unixODBC and MSSQL

I am using a script that's worked for me in the past on Windows, but
now that i've moved it to a Linux machine it is not. The trouble seems
to be when trying to insert escaped characters into a varchar field
(\n \r ,etc.).

-----------------------------------------------------------------------------
# conn = mx.ODBC.WINDOWS.DriverConnect('DSN=myDSN;UID=sa;PW D=pwd')

conn = mx.ODBC.unixODBC.DriverConnect('DSN=myDSN;UID=sa;P WD=pwd')
curr = conn.cursor()

# These strings do not work:
# mystring = "Some text \n and some other text"
# mystring = "Some text \t and some other text"
# mystring = """Some text
and some other text"""

# This tring works just fine:
mystring = "Some text and some other text"
sql_insert = "insert into DEV..msg(message_id,body) values(?,?)"

curr.execute(sql_insert, (1,mystring))
curr.close()
conn.commit()
-----------------------------------------------------------------------------

Here's the error message:

Error Type: OperationalError
Error Value: ('', 8179, '[unixODBC][FreeTDS][SQL Server]Could not find
prepared statement with handle 0.', 6083)

Any ideas greatly appreciated.

Apr 1 '06 #1
0 1080

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Cary | last post by:
Trying to install on SuSE 8.2 from source. ../configure --with-apxs=/usr/local/apache/bin/apxs --with-mysql --with-unixODBC=/usr/lib getting this error: /root/php-4.3.2/ext/odbc/php_odbc.c -o...
9
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my...
0
by: Tbird67ForSale | last post by:
Has anyone had much luck with UnixODBC on RedHat Linux. I've recently moved a 100 Gb MySQL database from Win2000 Server to a RedHat 9 server and installed UnixODBC to access it. It appears that...
0
by: Bang | last post by:
Hi All, Recently I installed unixODBC(2.2.3) and MySql and MyODBC on Redhat 9.0. After the installation, I am able to use test program isql to connect to the database I created with mysql. ...
3
by: Roy Souther | last post by:
Trying to get the unixODBC to work connecting to an IBM DB2 UDB V8.1. The DB2 server is running on Red Hat 8 and is tested and confirmed to be serving connections to Windows 98 clients using the...
1
by: Sean Davis | last post by:
I have just installed mxODBC on my x86_64 suse linux machine, where I use unixODBC for connection. Running queries from isql or DataManager works fine for the DSN that I am using. However, under...
12
by: Todd Michels | last post by:
Hi all, I am trying to send data from a form and insert it into a MSSQL DB. When I submit the data I get: Warning: mssql_query() : message: The name "Todd" is not permitted in this context....
0
bartonc
by: bartonc | last post by:
This is a work in progress (current and active). There are some issues to resolve in supporting multiple connection types and I plan to add PySQLite to the mix. The this update is due to my...
0
by: eGenix Team: M.-A. Lemburg | last post by:
On 2008-10-15 20:30, Terry Reedy wrote: It's going to look even better when we release version 4.0 in a year or so ;-) FWIW, we're still waiting for the dust to settle before going for a Py3k...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.