odbc

How do I create a Jet ODBC link to a SQL Server view with periods in the field names?

I need to create an ODBC link from an Access 2003 (Jet) database to a SQL Server hosted view which contains aliased field names containing periods such as: Seq.Group In the SQL source behind the view, the field names are encased in square brackets... SELECT Table._Group AS [Seq.Group] ...so SQL Server doesn't complain about creatin...

What is the simplest, most maintainable way to create a SQL Server ODBC Data Source?

I need a programmatic way of creating a SQL Server ODBC Data Source. I can do this by directly accessing the Registry. It would be better if this could be done via an available (SQL Server/Windows) API to protect against changes in the registry keys or values with updated SQL Server drivers. Accepted Answer Note: Using SQLConfigDataSour...

Tool: ETL from an ODBC to SQL 05?

I just want a simple tool that will help me quickly write scripts/packages that I can schedule to run. My transform requirements are pretty simple (changing column names, merging/splitting tables, and date conversions). I'll sacrifice flexibility for speed of development on this one. Any come to mind? ...

What Oracle driver should I install in my MS SQL server to be able to use DTS to copy data from the Oracle server to the MS SQL server?

Hi, I have an Oracle server (version 9, I believe) and a MS SQL server (version 2000). The MS SQL server is running MS Windows Server 2003. I would like to use DTS to extract some data from the Oracle server and pour it into the MS SQL server. I'm having problems finding out what driver I should install on my MS SQL server for it to b...

C++ SQLBindParameter

Here are the declarations of the variables: string strFirstName; string strLastName; string strAddress; string strCity; string strState; double dblSalary; string strGender; int intAge; ...Do some "cin" statements to get data... retcode = SQLPrepare(StatementHandle, (SQLCHAR *)"INSERT INTO EMPLOYEE ([FirstName], [LastName], [Address],...

How do I work with Multiple Recordsets in C++ ODBC

I am trying to streamline a complex process of storing information in multiple tables and them linking them to a central table. The linking occurs using IDENTITY values generated in each table to provide the unique linking. I know I can use a combination of SET NOCOUNT ON and SELECT @@identity to get each identity, but that still requi...

How can I expose a C ODBC connection to a JVM using JNI?

I'm embedding a JRE in an existing C application using the invocation API, and I'd like to be able to use JDBC to work with the database in that code. This application is a transaction processing application, and the database transaction is managed by code in the C portion of the application, and the java code must run within that trans...

What does the setting WorkArounds2=8192 do on an ODBC connection?

My company has a 3rd party application that runs on a Progress database. I've been building an application on top of their database using an ODBC connection. One of the "quirks" of Progress is that it doesn't honor SQL column widths, so it will allow 100 characters in a column defined as a varchar(50). When reading this data via ODBC,...

Windows Authentication in SQL Sever 2000 for an account not logged into Windows

An advantage by using Windows Authentication is that I do not need to provide a username and password to log into the server as the user currently logged into Windows. But in a specific case I would like to log into the SQL Server as another user, using the same Windows Authenticated ODBC connection. So, the question: Is it possible to ...

What does the SQL Server Error "String Data, Right Truncation" mean and how do I fix it?

We are doing some performance tests on our website and we are getting the following error a lot: *** 'C:\inetpub\foo.plex' log message at: 2008/10/07 13:19:58 DBD::ODBC::st execute failed: [Microsoft][SQL Native Client]String data, right truncation (SQL-22001) at C:\inetpub\foo.plex line 25. Line 25 is the following: SELECT DISTINCT ...

From SPSS, import data from SQL Server Analysis Services

I'm wondering if there is an easy way to load data from analysis services (SSAS) into SPSS. SPSS offers a product to put SPSS functionality on the analysis server, but to me this is backwards. I don't want to learn about SPSS or have the SPSS users in the office learn something else. I just want to give the analysis services data to...

Proper way to connect ODBC data source with Delphi 2006+ ?

Hi, What's proper way to connect ODBC datasources and execute some SQL statements? TQuery and other BDE components can do it, but if I understood correctly they are now deprecated? ...

MS Access query design hangs on connection to SQL Server

Microsoft Access is a slick way to access data in a MS SQL Server backend database, but I've always had problems accessing (so to speak) large tables of data, especially when trying to toggle between results and design mode in Access. Access gives me a number of nifty things, not the least of which is Crosstabs, but this hung connection...

Oracle ORA-12154: TNS: Could not resolve service name Error?

I am a SQL Server user . I am on a project that is using oracle (which I rarely use) I need to create an ODBC connection so I can access the some data via MS Access I have a application on my machine called oraHome90. It seems to allow a configuration of something called a listener in a “net configuration utility”, I think that a “Loca...

Why does the Store Procedure I'm calling over ODBC fail at the same location?

I'm using the freeodbc++ library to access data on a MS SQL Server 2000 database (SP3? SP4?). In particular, I'm running a particularly long and nasty stored procedure. I can watch the procedure execute in SQL Profiler, however, it tends to stop processing at a certain point. No error codes or exceptions thrown. If I comment out the ...

ODBC x64 oracle problem

I have a workstation with Windows 2008 x64, MS Access 2007 and Oracle 11g x64 I use Access to connect to Oracle via ODBC. I am the administrator (in the administrator group) on the workstation. I run Access as administrator but when I want to make an ODBC call to Oracle it does not work. How do I do it: I start MS Access and creates a d...

Differences in prepared vs. direct statements using Oracle ODBC

I'm using an Oracle database with a collation different to my OS language. I'm accessing the database using the ODBC driver. When I prepare a statement (e.g. a "select * from x where=?"), that involves special non-ASCII characters supported by the DB's collation, I'm finding the data row with the characters. When I execute the select dir...

Why is OdbcCommand.ExecuteScalar() throwing an AccessViolationException?

I have a block of code intended to pull text descriptions from a database table and save them to a text file. It looks like this (C# .NET): OdbcCommand getItemsCommand = new OdbcCommand("SELECT ID FROM ITEMS", databaseConnection); OdbcDataReader getItemsReader = getItemsCommand.ExecuteReader(); OdbcCommand getDes...

How to Select data from Table from a DSN in T-SQL?

How can I get data from a database that I can only access through an ODBC Data Source (DSN) in T-SQL MS SQL Server, any version? ...

Need a row count after SELECT statement: what's the optimal SQL approach?

I'm trying to select a column from a single table (no joins) and I need the count of the number of rows, ideally before I begin retrieving the rows. I have come to two approaches that provide the information I need. Approach 1: SELECT COUNT( my_table.my_col ) AS row_count FROM my_table WHERE my_table.foo = 'bar' Then SELECT my_t...