dsn

Keyword not supported exception when attempting to use a connection string that points to a ODBC DSN

天大地大妈咪最大 提交于 2019-12-06 01:50:07
问题 I created an ODBC DSN for my Asp.Net MVC application's database access. One of the main reasons is it makes it easy to keep database credentials (such as server address, port, username, and password) out of source control without hindering my publishing abilities. So I changed my connection to be DSN=MyDSN . Unfortunately, when I run my Entity Framework queries I get Exception Details: System.ArgumentException: Keyword not supported: 'dsn'. Does anyone know what I am doing wrong? 回答1: If you

Is it possible to use (fluent)nhibernate with an odbc connection?

♀尐吖头ヾ 提交于 2019-12-05 12:30:10
i have to use a custom odbc driver. All i need to pass as a connection string is the DSN. How do i do this with (fluent)nhibernate? FluentNHibernate.Cfg.Db does only offer a OdbcConnectionStringBuilder class with an DSN method. How do i use this? You can create your own OdbcConfiguration class that derives from PersistenceConfiguration . Depending on your database, you will have to replace the Dialect in the following class. public class OdbcConfiguration : PersistenceConfiguration<OdbcConfiguration, FluentNHibernate.Cfg.Db.OdbcConnectionStringBuilder> { protected OdbcConfiguration() { Driver

Powershell to read from database using ODBC DSN instead of connection string

帅比萌擦擦* 提交于 2019-12-05 11:04:26
I know how to read value from database using connectionstring, i.e. Establish database connection to read $conn = New-Object System.Data.SqlClient.SqlConnection $conn.ConnectionString = "Server=10.10.10.10;Initial Catalog=database_name;User Id=$username;Password=$password;" $SQL = "..." $conn.Open() # Create and execute the SQL Query $cmd = New-Object System.Data.SqlClient.SqlCommand($sql,$conn) $count=0 do{ try{ $rdr = $cmd.ExecuteReader() while ($rdr.read()){ $sql_output += ,@($rdr.GetValue(0), $rdr.GetValue(1)) $count=$count + 1 } $transactionComplete = $true } catch{ $transactionComplete =

Command line to change path to .mdb file for MS Access ODBC System DSN?

拈花ヽ惹草 提交于 2019-12-04 16:19:18
What odbcconf.exe command line can I use to change the path to the MS Access .mdb file for an already existing System DSN? matt wilkie To answer the question as asked, here is a solution using odbcconf.exe instead of going straight to the registry: odbcconf.exe configsysdsn ^ "Microsoft Access Driver (*.mdb, *.accdb)" ^ "DSN=OurConnectionName;DBQ=X:\Path\to\OurMsAccessDB.mdb" Two items of note which had me tripped up for a while: make sure you use 64bit odbcconf.exe when on a 64bit system, see https://stackoverflow.com/questions/6721702/windows-7-64-bit-odbc-drivers-for-ms-access-missing . use

Programatically create ODBC connection and link tables in MS Access

旧街凉风 提交于 2019-12-04 12:36:34
问题 We are using MS Access as a reporting front-end for Oracle. The data is accessed via an ODBC connection, and there are two linked tables in Access to Oracle that are the raw data tables. I'd like to be able to set up the connection and link the tables from within the Access file. That way users don't have to worry about setting up an DSN for the ODBC connection (most of them are not very technical users, and will require hand-holding for something like this), and we can eventually have the

Connect to MySQL database and fetch data in Julia

…衆ロ難τιáo~ 提交于 2019-12-04 07:45:24
How can I fetch data from MySQL database in Julia? It looks like this package provides tools for connecting to any database, including MySQL. However, it looks like assuming I have to first setup ODBC DSN to connect to it (I don't know what it is in the first place, although I've used MySQL for two years). So I tried to configure it by reading this page at MySQL documentation... but hit the wall immediately. One, I can't find a command named myodbc-installer in my OS X 10.8.5. Two, there is no such application called ODBC Administrator , and instead there is ODBC manager in my system - So I

Enumerating the list of DSN's set up on a computer

荒凉一梦 提交于 2019-12-03 08:50:57
I have an Excel application in which I want to present the user with a list of the Data Source Names (ie: DSN's), whereby s/he can choose what data source to use. Hopefully once I've got the list, I can easily access the DSN properties to connect to the appropriate database. Please note, I do not want to use a DSN-less connection. The DSN entries are stored in the registry in the following keys. HKEY_CURRENT_USER\Software\ODBC\ODBC.INI\ODBC Data Sources HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources This contains the list of all defined DSN. This acts as an global index and the

ms access; how to move it into inaccessible state / DSN-less table without password

断了今生、忘了曾经 提交于 2019-12-02 16:09:20
问题 I tried to import tables from an already opened MS Access accdb file into a new accdb file using the built in import menu, but I got an error message. The error message said that the "admin" user has set the file in an inaccesible state. (this is my translation from hungarian) So I was not able to import any table or query. I would like to know, how to move an accdb or accde file into this inaccesible state programmatically, using VBA code. Reason behind: I would like to distribute a front

Neither DSN nor SERVER keyword supplied

纵然是瞬间 提交于 2019-12-01 18:20:02
I am trying to connect to SQL database slightly different ways: with and without use of parameter. Why without use of parameters works fine, but with use of parameters - gives me an error. Did I make a syntax error? I went through each letters and couldn't see anything. import pandas as pd import pyodbc #parameters: server = 'SQLDEV' db = 'MEJAMES' #Create the connection conn = pyodbc.connect('DRIVER={SQL Server};server =' + server + ';DATABASE = ' + db + ';Trusted_Connection=yes;') # query db sql = """ select top 10 PolicyNumber, QuoteID, ProducerName from tblQuotes """ df = pd.read_sql(sql

Neither DSN nor SERVER keyword supplied

北慕城南 提交于 2019-12-01 18:02:13
问题 I am trying to connect to SQL database slightly different ways: with and without use of parameter. Why without use of parameters works fine, but with use of parameters - gives me an error. Did I make a syntax error? I went through each letters and couldn't see anything. import pandas as pd import pyodbc #parameters: server = 'SQLDEV' db = 'MEJAMES' #Create the connection conn = pyodbc.connect('DRIVER={SQL Server};server =' + server + ';DATABASE = ' + db + ';Trusted_Connection=yes;') # query