odbc

Returning primary key on INSERT with pyodbc

▼魔方 西西 提交于 2019-12-25 08:49:45
问题 I have a program inserting a bunch of data into an SQL database. The data consists of Reports , each having a number of Tags . A Tag has a field report_id , which is a reference to the primary key of the relevant Report . Now, each time I insert the data, there can be 200 Reports or even more, each maybe having 400 Tags . So in pseudo-code I'm now doing this: for report in reports: cursor_report = sql('INSERT report...') cursor_report.commit() report_id = sql('SELECT @@IDENTITY') for tag in

MS Access form does not refresh when using ODBC link to MySql

Deadly 提交于 2019-12-25 07:58:48
问题 I have a front-end Access 2007 database connecting to MySql tables using MySQL ODBC connector. The problem is that a form linked to a table will not refresh its data if the data are changed by another user on the network or if the data was changed by a pop-up form. If I create a VBA code which detects the change and then refresh the form or requery, then the form which shows many records in a table like format, will jump to its top, and some users will lose the sight of the record which is

Warning: db2_fetch_assoc(): Fetch Failure

假如想象 提交于 2019-12-25 06:57:41
问题 This is probably very simple (I'm a novice), but I haven't been able to find an answer. I'm using Linux, DB2 and PHP. My simple DB2 query from PHP only returns rows with integer values, but fails with "Fetch Failure" for anything else (varchar ...). The query works with db2cli for all values: echo "select COLUMN from TEST.TABLE"" | ./db2cli execsql -dsn SCHEMA But fails in PHP: $conn_string = "DRIVER={IBM DB2 ODBC DRIVER};DATABASE=$database;" . "HOSTNAME=$hostname;PORT=$port;PROTOCOL=TCPIP

How to read numeric/decimal/money columns from SQL Server?

 ̄綄美尐妖づ 提交于 2019-12-25 06:25:49
问题 I try to read numeric/decimal/money columns from SQL Server via ODBC in the following manner: SQL_NUMERIC_STRUCT decimal; SQLGetData(hSqlStmt, iCol, SQL_C_NUMERIC, &decimal, sizeof(decimal), &indicator); All these types are returned as SQL_NUMERIC_STRUCT structure, and I specify the SQL_C_NUMERIC type to SQLGetData() API. In the database, column is defined as decimal(18, 4) for example, or money . But the problem is that the returned data has decimal.precision always set to 38 (max possible

Connecting to an Advantage Database with PHP on Windows

人走茶凉 提交于 2019-12-25 05:17:08
问题 I have a customer that has an application that uses an Advantage Database. I am having problems trying to connect to it with PHP using ODBC or the PHP connector it get this discovery 6420 error which seems quite common. I think most of the problem is my laack of understanding of the Advantage Database. I am thinking the problem may be there is actually no server running? do that application maybe have its own kind of server maybe? I have written a small C# program that connects to the data

Connecting to an Advantage Database with PHP on Windows

故事扮演 提交于 2019-12-25 05:17:02
问题 I have a customer that has an application that uses an Advantage Database. I am having problems trying to connect to it with PHP using ODBC or the PHP connector it get this discovery 6420 error which seems quite common. I think most of the problem is my laack of understanding of the Advantage Database. I am thinking the problem may be there is actually no server running? do that application maybe have its own kind of server maybe? I have written a small C# program that connects to the data

I can't get correct max(len(fieldname)) of CSV file using Linq, SQL or MaxLength

[亡魂溺海] 提交于 2019-12-25 05:13:48
问题 I am trying to import a csv file and I need to get the maximum field length so I know how large to make my varchar field in the new table. I have a small table with the longest text value of 315. Here is a logical description of what is happening: If Len(Field) > 255 And RowNumOf315Record > 25 Then FieldLen = 255 If Len(Field) > 255 And RowNumOf315Record <= 25 Then FieldLen = 315 If we nuke all records with the field length > 255 then the correct length is always returned. I tried Linq: Table

Confusion when creating ODBC Conecction string

帅比萌擦擦* 提交于 2019-12-25 05:03:39
问题 I'm trying to create a connection string in order to work with a ODBC in a C# console application. var dbConnection = new OdbcConnection("DRIVER={Relativity Client};ServerName=192.168.1.5;Port=21060;Database=Analyzar;UID=USER;PWD=PASSWORD;"); Of course user and password have the right values. But I keep getting this error ERROR [08S01] [Liant][Relativity][Client][Client LNA]Client cannot access the data source because RelServer is not running at the specified port number. Contact your system

Dapper using ODBC store procedure Input parm always promt @XXX was not supplied

时光怂恿深爱的人放手 提交于 2019-12-25 04:49:09
问题 I need help from All Dapper master. I have been learning using Dapper since one month ago, but I have error when executing query using ODBC SP. The code originally was written by someone(DapperExample) but not using ODBC, thanks to the writer I forgot your name. My SP: CREATE PROCEDURE SP_GET_FIND_EMPLOYEES (@EmpID INT) AS BEGIN SET NOCOUNT ON; SELECT * FROM tblEmployee WHERE EmpID = @EmpID END GO My Code public class EmployeeDashBoard : IEmployeeDashBoard { private IDbConnection _db; string

Perl Not Reading Full Values from Database

亡梦爱人 提交于 2019-12-25 04:32:18
问题 I am currently using the DBI module to connect to my MSSQL Database to pull some data from a table. The row I am trying to pull contains a lot of text (it is of type ntext and can contain up to 6Mb of text). My query is a very simple one at the moment: my $sql = "SELECT TOP 1 [reportRow] from UsageReport"; And I also have LongTruncOk enabled for the Database options. After I execute the query, I want to display the rows. while ( my @row = $sth->fetchrow_array ) { print "@row\n"; }