odbc

Get Number of Rows from a Select statement

与世无争的帅哥 提交于 2020-01-21 02:49:26
问题 I have this: $dbh = new PDO("odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq=$mdbFilename", $username, $password); $sql = "SELECT * FROM this_table"; $stmt = $dbh->query($sql); //num of rows? How do I get the number of rows returned from that SELECT statement? Thanks all 回答1: SELECT count(*) FROM this_table is an option... Regarding rowCount: PDOStatement::rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement executed by the corresponding

odbc syntax to update

不羁的心 提交于 2020-01-17 09:08:59
问题 string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" + "SERVER=localhost;" + "DATABASE=new_db;" + "UID=root;" + "PASSWORD=password;" + "OPTION=3"; OdbcConnection MyConnection = new OdbcConnection(MyConString); OdbcCommand cmd = new OdbcCommand("UPDATE awm_create SET referral_email=?' WHERE email=? " , MyConnection); //cmd.Parameters.Add("@tb_refemail", OdbcType.VarChar, 255).Value = tb_refemail.Text.Trim(); //cmd.Parameters.Add("@tb_email", OdbcType.VarChar, 255).Value = tb_email.Text.Trim

odbc syntax to update

匆匆过客 提交于 2020-01-17 09:08:16
问题 string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" + "SERVER=localhost;" + "DATABASE=new_db;" + "UID=root;" + "PASSWORD=password;" + "OPTION=3"; OdbcConnection MyConnection = new OdbcConnection(MyConString); OdbcCommand cmd = new OdbcCommand("UPDATE awm_create SET referral_email=?' WHERE email=? " , MyConnection); //cmd.Parameters.Add("@tb_refemail", OdbcType.VarChar, 255).Value = tb_refemail.Text.Trim(); //cmd.Parameters.Add("@tb_email", OdbcType.VarChar, 255).Value = tb_email.Text.Trim

Connect to MySQL using SHA2

99封情书 提交于 2020-01-17 07:22:49
问题 I have access to 2 MySQL Servers (one for production and one for development). I have the host, port, database, user, password and the CA Cert file for them. I could connect to both using mysql workbench and from the windows cmd. (Yes, I have to work on windows for now) Now according to security requirements, I need to connect using protocol TLSv1.2 or TLSv1.2, and Cipher AES256 and SHA2. These are currently not enforced on the development server, but they are on the production, and I am not

FileMaker's ODBC Driver doesn't release Handles (memory leak)

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-17 02:24:07
问题 After a whole day tracking down a memory leak in my VB.NET project, I have traced the cause to a bug with FileMaker's ODBC driver ! To reproduce you'll need a database you can connect to (I have mine hosted on Server Advanced 11.0.3, but you can also host it locally), and the ODBC driver registered/installed on the PC (I tested versions 11.3 and 12.0, and the latest 12.2). Start a new VB.NET WinForms project, add a button to the form and paste this code onto the button's click event: Using cn

Connect to MS SQL Server Database Using isql on Mac

徘徊边缘 提交于 2020-01-16 18:17:31
问题 Summary: tsql connects and isql doesn't. Details: I have tried every official installation guide and Stack Overflow question I can find, but none of them produce joy. I'm trying to connect to a MS SQL Server database from my Mac (Mohave), and ultimately a Xubuntu 16.04 virtual machine as well, using pyodbc . Before getting into the Python, I just want to trouble-shoot the connection. The problem is, most of the documentation I'm seeing is missing important details such as, "Should I use

How can I fix ORA: 01013 (user requested cancel…) when trying to link Oracle tables in MS Access?

 ̄綄美尐妖づ 提交于 2020-01-16 18:11:42
问题 I have installed Oracle Express (XE, version 18) on a Windows 10 (64-bit) machine with Office 365 (32-bit) installed. I have installed the correct Oracle Instant Client (18_3) and its ODBC package (32-bit versions). I successfully created a DSN using the ODBC Data Source Administrator (32-bit) tool in windows. When I attempt to link tables into an Access database, I get error ORA: 01013. If I remove the timeout from the DSN configuration, it simply spins with the Oracle RDBMS kernel eating up

informix ODBC stored procedure always return incorrect same value

岁酱吖の 提交于 2020-01-16 18:07:50
问题 I have a simple sp created in Informix create procedure test(arg1 int) returning int; if arg1 > 1 then return 10; else return 0; end if; end procedure; It works as expected when called directly into Informix but when I call it from VB.NET using ODBC, it returns always 1. Here's my vb code Dim cmd As OdbcCommand = New OdbcCommand("{call test()}", conn) With cmd .CommandType = CommandType.StoredProcedure .Parameters.AddWithValue("@arg1", 0) End With conn.Open() Dim dt As DataTable = New System

Handling a SQL Server Login error msg with VBA?

拜拜、爱过 提交于 2020-01-16 17:18:18
问题 I'm working in a VBA module for Access that queries linked tables, generates reports based off the data, and then uses a PDF printer to save the reports to disk. There's a timer in the primary form that will, every N seconds, run an Access query against a "JOBQUEUE" table to see if there are new jobs. If the database server becomes unavailable, this operation will of course time out. The run-time error of 3051 is being logged, and the loop will try to continue. The loop can't finish, however,

Handling a SQL Server Login error msg with VBA?

醉酒当歌 提交于 2020-01-16 17:15:27
问题 I'm working in a VBA module for Access that queries linked tables, generates reports based off the data, and then uses a PDF printer to save the reports to disk. There's a timer in the primary form that will, every N seconds, run an Access query against a "JOBQUEUE" table to see if there are new jobs. If the database server becomes unavailable, this operation will of course time out. The run-time error of 3051 is being logged, and the loop will try to continue. The loop can't finish, however,