odbc

What is the problem with ODBC as a technology?

Recently Zed Shaw (a programmer who blogs) mentioned that ODBC references should be removed from the popular python book Dive into Python. I have never worked with ODBC and I just wanted to understand why ODBC is so "bad". What are the pros and cons of the technology? What alternatives are there? ...

What is the correct connection string for clsql when accessing ms sqlserver using odbc?

I am accessing a database on another machine from an OS X server. After setting up freetds through macports and creating the freetds.conf file like so: dump file = /tmp/freetds.log # nunb our Microsoft server [winnt] host = 192.168.0.2 port = 1433 tds version = 8.0 I have the following test commands that work:...

OdbcConnection for a string in a csv

I've got some code below that would allow me to access a .csv file on the server and pull the contents into a datatable which enables me to iterate the rows easily. For somethine completely seperate I have the contents of a csv in a string variable and I'd like to be able to pull that string into a datatable also. How can I do this witho...

Embed SQL Password into Crystal Reports RPT file?

We are experimenting with Crystal Reports viewers such as this one: http://www.thereportviewer.com/ ... which can actually re-connect to the data source and re-run a Crystal Reports RPT file with live data. However when running the report the viewer asks for a password to connect to the data source (in this case SQL Server). Does Cry...

"Executing SQL directly; no cursor" error when using SCOPE_IDENTITY/IDENT_CURRENT

There wasn't much on google about this error, so I'm asking here. I'm switching a PHP web application from using MySQL to SQL Server 2008 (using ODBC, not php_mssql). Running queries or anything else isn't a problem, but when I try to do scope_identity (or any similar functions), I get the error "Executing SQL directly; no cursor". I'm d...

ODBC - multiple connections from one app to the same data source

I vaguely remember reading somewhere (in MSDN ODBC documentation?) that one application cannot make more than one connection to a single data source. It seemed to me that I need one connection that all the threads of the application will have to share. I was trying to look this information up, but I can't seem to find it anymore. Does an...

Final form of parametric SQL commands in ADO.NET

I am getting a syntax error when I send a parameterized query to Access from my C# program via ADO.NET. I, of course, know what SQL string I have included in my code, with the parameter names embedded inside. Does anyone know how I can look at the SQL string that is finally sent to the DBMS during after I call cmd.ExecuteNonQuery? Tha...

informix odbc connection slow to open in asp.net

I have an application that takes a long time to open odbc connections (like 20 sec) also takes forever using arcmap and arcsde but when I try the connection on the odbc data source administrator, it tests it really fast Does anyone have any idea of what my be causing this? btw the application works fine in another computer with anothe...

Logging ODBC, SQL Server

How to log, trace or get queries that an application send to Microsoft SQL Server 2008 thru ODBC driver (without modifying application...) Maybe it can be done with SQL Server itself or ODBC has some query logging? ...

Connect to SQL Server from batch script

Hi, I am supplying a batch script to create a DSN connection in the user computer before they start to use my application. I am using this in a .bat file. ODBCConf ConfigSysDSN "SQL Server" "DSN=CONNAME|SERVER=PCNAME\INSTANCENAME But I want to make sure they will be able to connect to the database, considering the fact that proper dr...

Trying to Export Data from an unusal Access Database with Synonyms

We use a product called SalesOutlook which is a type of CRM system. I need to export data from this using SSIS or some other program. When you install the program, it creates a DSN on my system called SalesOutlookReports. It use the Microsoft Access Driver (*.mdb). When I try to look at it using Crystal Reports I see a list of tables...

Php/ODBC encoding problem

I use ODBC to connect to SQL Server from PHP. In PHP I read some string (nvarchar column) data from SQL Server and then want to insert it to mysql database. When I try to insert such value to mysql database table I get this mysql error: Incorrect string value: '\xB3\xB9ow...' for column 'name' at row 1 For string with all ASCII chara...

Is DB2 Connect neccessary if I'm using Zend Server for i5/OS?

I have Zend Server for i5/OS and want to connect (in PHP) to local DB2 Instance. Do I need DB2 Connect product to call any program on i5/OS? If I can use ODBC Driver, can somebody - please - give me an url to some place where I can download it (OpenSource?) ? Another question: Is there any PDO_ODBC or ODBC adapter for Zend Framework's Z...

ODBC vs MySQLClient

I'm currently using ODBC to connect to my MySQL database, using C#. I've been told that using the MySql Connector would be better, and faster, and not dependent on Windows. Can someone shed some light on this please? I've been unable to find anything on the net so far ...

SQL Server: ODBC Connection pooling / C API

I want to clarify how to do connection pooling with SQL Server from C, using ODBC. I know this question is, like.... sooooo 1998, but... I've never done it in C, so... here goes: First I think I have to set the attribute to enable pooling: rc = SQLSetEnvAttr( NULL, // make process level cursor pooling SQL_ATTR_CO...

PHP ODBC MDB Access on a Cloud Server

Hey! Hopefully quick question.... I have a .MDB file stored on my webserver and I'm trying to connect to it. I have no way of "registering" it with a name in ODBC. Is the only way to connect to it by specifying the absolute page of the .mdb file? $mdbFilename = "./db/Scora.mdb"; $connection = odbc_connect("Driver={Microsoft Ac...

using a connection string in web.config for crystal report

I`m having problems between two servers, wich use differente odbc dsn. My apps work great but crystal reports uses the original odbc connection, how can I fix this? I'm thinking of using the same connection string in the web.config, but I don't know how. found this but is too confusing for me thanks, ...

Creating an SQL variable character column > 255 characters supporting multiple databases

I have an application that stores data through an ODBC data source of the user's choosing. So far it has worked well on a range of database systems (e.g. JET, Oracle, SQL Server), as the SQL syntax is fairly simple. Now I am running into a problem where I need to store more than 255 characters in my strings. Previously I created the tab...

OdbcCommand on Stored Procedure - "Parameter not supplied" error on Output parameter

I'm trying to execute a stored procedure (against SQL Server 2005 through the ODBC driver) and I recieve the following error: Procedure or Function 'GetNodeID' expects parameter '@ID', which was not supplied. @ID is the OUTPUT parameter for my procedure, there is an input @machine which is specified and is set to null in the stored...

Data type mismatch in criteira expression

I'm getting this error: Data type mismatch in criteira expression when trying to execute this query in access: select sum(total_sum) from totals_table where tot_date >= '3/01/2010' and tot_date < '4/01/2010' P.S. tot_date is of type Date/Time and tot_sum is of type Number ...