odbc

R ODBC MySQL Connection Example

放肆的年华 提交于 2019-12-05 07:21:28
问题 I'm trying to use RODBC to connect to a MySQL db on my computer (I'm assuming it's localhost). I've read the package reference manual and can't figure out how to do anything (connect, set default driver, open channel, etc). Any suggestions? EDIT: > install.packages("RMySQL", type="source") Installing package(s) into ‘C:/Users/backupSam/Documents/R/win-library/2.13’ (as ‘lib’ is unspecified) trying URL 'http://lib.stat.cmu.edu/R/CRAN/src/contrib/RMySQL_0.8-0.tar.gz' Content type 'application/x

Insert binary data into SQL Server using PHP

社会主义新天地 提交于 2019-12-05 07:19:47
I have a varbinary(MAX) field in a SQL Server 2005 database. I'm trying to figure out how to insert binary data (ie. an image) into that field using PHP. I'm using ODBC for the connection to the SQL Server database. I have seen a number of examples that explain this for use with a MySql database but I have not been able to get it to work with SQL Server. Thanks. The simple answer is: stop what you're doing. You don't want to store binary files inside a database unless you have some very specific security issues. Instead you want to store their filenames (possibly rename the files to prevent

Passing table name as a parameter in pyodbc

纵饮孤独 提交于 2019-12-05 06:32:59
I am trying to pass a table name in pyodbc as a parameter to access data from ms sql 2005. I've tried to substitute it with ? but it never works. I would be glad to receive any advice on how to accomplish this. Since you are using pyodbc, I assume you are not calling a SPROC. I recommend building your SQL string in python and then passing it to SQL to execute. import pyodbc dbconn = pyodbc.connect(ConnectionString) c = dbconn.cursor() j = 'table1' #where table1 is entered, retreived, etc query = "Select * from %s" % j c.execute(query) result = c.fetchall() print 'Done' You can't have variable

C# Open DBF file

ぃ、小莉子 提交于 2019-12-05 05:52:17
I'm having a problem opening a DBF file - I need to open it, read everything and process it. I tried several solutions (ODBC/OLEDB), several connection string, but nothing worked so far. The problem is, when I execute the SQL command to get everything from the file, nothing gets returned - no rows. What's even more odd, the content of the DBF file being opened get deleted. See the code I have: public override bool OpenFile(string fileName, string subFileName = "") { OleDbConnection con = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Path.GetDirectoryName(fileName) + "

How can several users work on the same Enterprise architect file?

限于喜欢 提交于 2019-12-05 04:15:15
问题 I'm wondering if many users can work on the same Enterprise Architect file ? our professor said it can be done if we can host the file in a repository and then link it to windows ODBC ? I'm not sure what does that means. 回答1: There are two ways to set up an EA project: stored in an .EAP file (accessed through the file system), or stored in a database (accessed through ODBC) The file actually contains a database, and EA provides functionality for migrating both ways between the two. An .EAP

Nodejs ODBC Connection on Windows

跟風遠走 提交于 2019-12-05 02:25:47
I have a project that would be perfect for Node.js, but it has to connect to a ODBC database and it has to run on windows. I see ODBC modules for nodejs on linux, but not windows. Does anyone have any suggestions on how to do this? cmroanirgo If you're like me and arrived here from Google, because you have old (ie ancient) systems, I came across Is it possible to marry WSH (wscript) with nodejs and was alerted to the npm module "win32ole": https://www.npmjs.com/package/win32ole . While not just an ODBC solution, "win32ole" does give you the ability to do quite a lot on a windblows box, just

sqlalchemy connect to server, with not specify database

醉酒当歌 提交于 2019-12-04 23:48:02
问题 Is it possible to connect to MSSQL server , using sqlalchemy and thencreate a database? I use the following: sqlalchemy.create_engine("mssql+pyodbc://sa:pwd@localhost/") But I get an error: Detail DBAPIError: (Error) ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (SQLDriverConnect)') None None I would like to connect to the server, then create database and work with it. 回答1: Give it a try: import urllib connection_string =

How do I access a SQL Server database from a Perl script in Linux?

泪湿孤枕 提交于 2019-12-04 23:37:18
问题 I have a Perl script on a Linux (Ubuntu 8.10) machine and I need to write data to a SQL Server Database. I've been trying to use the DBD::ODBC module but I can't get it to connect. Where can I get a free/open source driver to use to use for the ODBC connection or is there another way to do this from Perl on Linux? 回答1: I connect to SQL Server 2005 with the stack of unixODBC, freeTDS (this is the driver) and DBD::ODBC. After you install these components, edit /etc/unixODBC/odbc.ini to read

MDB access using php

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 20:24:51
I am having a little bit of trouble trying to write to a .mdb database from php. The database has a table called comments and it has 3 columns "id", "comment" and "by". The code I have is this. <?php $count =0; $db_path = "newsBlog.mdb"; $odbc_con = new COM("ADODB.Connection"); $constr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . $db_path . ";"; $odbc_con -> open($constr); $sql = "INSERT INTO [comments] VALUES (".$_POST['newsId'].",'".$_POST['comment']."', '".$_POST['by']."')"; echo $sql; $odbc_con -> execute (sql); $rs = null; $conn = null; echo "done"; ?> It takes 3 values from a

pyODBC and SQL Server 2008 and Python 3

非 Y 不嫁゛ 提交于 2019-12-04 20:23:01
I have pyODBC installed for Python 3.2 and I am attempting to update a SQL Server 2008 R2 database that I created as a test. I have no problem retrieving data and that has always worked. However when the program performs a cursor.execute("sql") to insert or delete a row then it does not work - no error, nothing. The response is as if I am successful updating the database but no changes are reflected. The code below essentially is creating a dictionary (I have plans for this later) and just doing a quick build of a sql insert statement (which works as I testing the entry I wrote to the log) I