odbc

Invalid cursor state, SQL state 24000 in SQLExecDirect

亡梦爱人 提交于 2020-01-12 05:54:34
问题 I need to call two stored procedures in sequence via ODBC in PHP: #run stored procedure 1 $query = "Shipped_Not_Shipped_Rep ".$_GET['rep_id']; $result = odbc_exec($dbh, $query); odbc_result_all($result); #run stored procedure 2 $query = "Shipped_Not_Shipped_Account ".$_GET['account_id']; $result = odbc_exec($dbh, $query); odbc_result_all($result); I'm getting this error in PHP after the second stored procedure call: Warning: odbc_exec() [function.odbc-exec]: SQL error: [unixODBC][FreeTDS][SQL

MySQL ODBC Link Fails due to “authentication protocol refused”

牧云@^-^@ 提交于 2020-01-12 04:48:07
问题 I've had a good search around but not yet found an answer that allows me to rectify this problem. I'm trying to connect from MS Access to a MySQL 5.2 database on a remote server. I've set up a user account which has select, insert, update, delete privileges on the table in question. However, when I try to connect with this account, I get: Connection Failed [HY000][MySQL][ODBC 5.2(w) Driver] Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)

PHP Array inserting too many records in the database

≯℡__Kan透↙ 提交于 2020-01-11 13:24:34
问题 If i enter only 1 record. It saves only 1 record in the database which is fine. But if i put two records of the same fields. It saves multiple records in the database which should only be two. What did i do wrong? <td>1.<input name='Description[]' type='text' required></td> <td><input type='text' name='Unit[]' placeholder='eg. reams,pcs,box' required></td> <td><input type='number' name='Quantity[]' min='1' required></td> <td><input type='number' name='Cost[]' min='1' required></td> </tr> I

PHP Array inserting too many records in the database

此生再无相见时 提交于 2020-01-11 13:24:33
问题 If i enter only 1 record. It saves only 1 record in the database which is fine. But if i put two records of the same fields. It saves multiple records in the database which should only be two. What did i do wrong? <td>1.<input name='Description[]' type='text' required></td> <td><input type='text' name='Unit[]' placeholder='eg. reams,pcs,box' required></td> <td><input type='number' name='Quantity[]' min='1' required></td> <td><input type='number' name='Cost[]' min='1' required></td> </tr> I

Cannot display Greek characters .mdb file (PHP & ODBC)

依然范特西╮ 提交于 2020-01-11 12:49:05
问题 I am having problems displaying text from a column in an MS Access 2007 table which is in Greek. I am using PHP and $dbc = @odbc_pconnect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$mdbFilename", $user, $pass); to read from a local .mdb file. I can successfully read the rest of the data in the DB which is in Latin characters. Greek characters get displayed as � when I echo the results. The html charset is properly set to utf-8. I've tried using utf8_encode with no luck. I've been searching

Why the output parameter of my ADODB.Command does not retrieve a value when executing?

半城伤御伤魂 提交于 2020-01-11 06:53:08
问题 I have a code in Classic ASP and SQL Server, the idea is simple, to have an stored procedure so you can insert a file but before that, the sp will check if the file already exists, after that will return an output parameter so I can check it on my asp page. The problem is the returning value of the output parameter is nothing, I cann´t figure out where is the problem.. The SP is: ALTER PROCEDURE [dbo].[pi_usu_crear_cuenta] @msg_salida char(1) OUTPUT /* 0=Registro ya existe, 1=Insert

CRecordset::snapshot doesn't work in VS2012 anymore - what's the alternative?

折月煮酒 提交于 2020-01-11 06:16:32
问题 Apparently, in VS2012, SQL_CUR_USE_ODBC is deprecated. [Update: it appears that the cursors library has been removed from VS2012 entirely]. MFC's CDatabase doesn't use it anymore (whereas it was the default for VS2010 and earlier versions of MFC), but instead uses SQL_CUR_USE_DRIVER. Unfortunately, SQL_CUR_USE_DRIVER doesn't work properly with the Jet ODBC driver (we're interacting with an Access database). The driver initially claims to support positional operations (but not positional

simple remote ODBC database connection with ruby

半世苍凉 提交于 2020-01-11 05:44:30
问题 I am attempting to make a simple connection to a remote database. I can not seem to get it to work. remote_db = DBI.connect('DBI:ODBC:remote-host','user','password') remote_db.table { |table| pp table } Any help would be greatly appreciated. 回答1: I think what you are looking for is Ruby DBI. http://ruby-dbi.rubyforge.org/ Here is an example of using DBI for ODBC connectivity: # Require in the DBI files<br /> require 'DBI' # create an ODBC connection instance<br /> dbi_conn = DBI.connect('DBI

“The data has been changed” error when stepping from main form into sub form

为君一笑 提交于 2020-01-11 04:54:10
问题 I'm migrating an Access database to SQL Server using the SQL Server Migration Assistant (SSMA). The Access application will continue to be used but with linked tables instead of local ones. I've run into a problem during the post-migration testing with a form that contains several sub forms. Testing steps: 1) Edit a field in the main form; 2) Shift focus to a field in the sub form; 3) Attempt to edit the field in the sub form. Result: An error message pops up: "The data has been changed.

Excel ODBC and 64 bit server

♀尐吖头ヾ 提交于 2020-01-11 04:39:06
问题 using ASP.NET I need to update an excel template. Our server is running Windows 2008 in 64 bit mode. I am using the following code to access the excel file: ... string connection = @"Provider=MSDASQL;Driver={Microsoft Excel Driver (*.xls)};DBQ=" + path + ";"; ... IF the application pool is set to Enable 32 bit applications the code works as expected; however the oracle driver I am using fails as it is only 64 bit. If Enable 32-bit applications is set to false the excel code fails with the