odbc

Can't open lib 'ODBC Driver 13 for SQL Server'? Sym linking issue?

不打扰是莪最后的温柔 提交于 2019-11-26 15:27:47
问题 When I try to connect to a sql server database with pyodbc (on mac): import pyodbc server = '####' database = '####' username = '####@####' password = '#####' driver='{ODBC Driver 13 for SQL Server}' pyodbc.connect('DRIVER='+driver+';SERVER='+server+';PORT=1443;DATABASE='+database+';UID='+username+';PWD='+password) I get the following error: Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 13 for SQL Server' : file not found (0) (SQLDriverConnect)") When I path

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

旧城冷巷雨未停 提交于 2019-11-26 15:26:40
I am trying to open a program for the first time on Windows XP Pro that uses PostgreSQL 9. I'm getting an error message that says : A problem was encountered while trying to log into or create the production database. Details: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified In my ODBC manager, I have a list of User DSN's and System DSN's. I tried installing a postgres odbc driver to see if that would help, but it didn't. There is a connect.dat file in the program file with a line saying "OLE DB Provider = MSDASQL". Changing this entry alters the

How to connect pyodbc to an Access (.mdb) Database file

被刻印的时光 ゝ 提交于 2019-11-26 14:47:45
问题 Here's what I've tried: -Find Vista's ODBC Data Source Manager* through search, -Add a new File Data Source*, selecting Driver for Microsoft Access (*.mdb), and selecting my mdb file of interest, -import pyodbc from python shell and try: pyodbc.connect("DSN=<that Data Source I just created>") I get the following error message (Portuguese**): Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Nome da fonte de dados n\xe3o encontrado e nenhum driver padr\xe3o especificado (0)

ASP.NET ODBC Query with parameters

淺唱寂寞╮ 提交于 2019-11-26 14:31:02
问题 Please help me, I don't know what can be wrong with the following code: OdbcConnection conn = new OdbcConnection(connString); String query = "INSERT INTO customer (custId, custName, custPass, "+ "custEmail, custAddress, custAge) VALUES (" + "@ID, @Name, @Pass, @Email, @Address, @Age)"; OdbcCommand exe = new OdbcCommand(query, conn); exe.Parameters.Add("@ID", OdbcType.UniqueIdentifier).Value = id; exe.Parameters.Add("@Name", OdbcType.VarChar).Value = name; exe.Parameters.Add("@Pass", OdbcType

Connect PHP to MSSQL via PDO ODBC

不打扰是莪最后的温柔 提交于 2019-11-26 14:30:45
When I execute this code: print_r(PDO::getAvailableDrivers()); It says I have the odbc driver available. Array ( [0] => mysql [1] => odbc [2] => sqlite ) However, when I try to use it like so: $handle = new PDO("odbc:Server=dbServerIpAddress,myportnumber;Database=mydatabase", "myusername", 'mypassword'); It doesn't do anything - no errors and it doesn't work at all. It won't even execute past that line! How can I connect PHP to this MSSQL database via PDO and ODBC? Benny Hill There are several configuration files you need to have set up. /etc/odbc.ini , /etc/odbcinst.ini and /etc/freetds

Check if a SQL table exists

ⅰ亾dé卋堺 提交于 2019-11-26 13:29:18
问题 What's the best way to check if a table exists in a Sql database in a database independant way? I came up with: bool exists; const string sqlStatement = @"SELECT COUNT(*) FROM my_table"; try { using (OdbcCommand cmd = new OdbcCommand(sqlStatement, myOdbcConnection)) { cmd.ExecuteScalar(); exists = true; } } catch { exists = false; } Is there a better way to do this? This method will not work when the connection to the database fails. I've found ways for Sybase, SQL server, Oracle but nothing

How do I change a Crystal Report&#39;s ODBC database connection at runtime?

与世无争的帅哥 提交于 2019-11-26 11:23:02
问题 I have a report made with Crystal Reports 2008 that I need to deploy a production system which means that I need to be able to change the database connection at runtime. The database is PostgreSQL 8.3.0 and the connection I use for creating the initial report is an ODBC connection. I have found various ways to change the database connection including the following: reportDoc.Load(report); reportDoc.DataSourceConnections[0].SetConnection(\"server\", \"database\", \"user\", \"pwd\"); reportDoc

PHP and Microsoft Access database - Connection and CRUD

回眸只為那壹抹淺笑 提交于 2019-11-26 11:19:06
问题 I have no experience with access. How to do update/insert/delete/select statement with and without $rs = new com(\"ADODB.RecordSet\"); ? 回答1: PDO If you want to interface with an MS Access database using PHP, PDO is available for you. <?php try { $pdo = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\accounts.mdb;Uid=Admin"); } catch (PDOException $e) { echo $e->getMessage(); } When using PDO, due to the unified interface for DB operations, you have the opportunity to make your

The specified DSN contains an architecture mismatch between the Driver and Application. JAVA

↘锁芯ラ 提交于 2019-11-26 11:15:43
I'm trying to connect to a database made by MS Access using Java, but I cannot seem to manage. I am using ODBC and I'm getting this exception: java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application My Java: package javaapplication2; import java.sql.Statement; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; /** * * @author Owner */ public class JavaApplication2 { /** * @param args the command line arguments * */ public static void main

How do I create an ODBC DSN entry using C#?

流过昼夜 提交于 2019-11-26 10:29:23
问题 I\'m working on a legacy application that has a C++ extended stored procedure. This xsproc uses ODBC to connect to the database, which means it requires a DSN to be configured. I\'m updating the installer (created using Visual Studio 2008 setup project), and want to have a custom action that can create the ODBC DSN entry, but am struggling to find useful information on Google. Can anyone help? 回答1: I actually solved this myself in the end by manipulating the registry. I've created a class to