473,289 Members | 2,087 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,289 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 1077

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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.