ado

“Row cannot be located for updating” error [another]

流过昼夜 提交于 2021-02-10 20:22:57
问题 I'm working with Delphi (XE3) and need to connect to a MySQL database. I'm having a strange problem that seems quite common but I still haven't entirely solved this problem. traditional solutions include: setting "Update Criteria" to adCriteriaKey. ensure your table has a primary key (and tell the ADO Table about it) problem 1: start the application, execute the code: if the new value happens to match what's already in the database, I get the error at position "B". problem 2: start the

“Row cannot be located for updating” error [another]

感情迁移 提交于 2021-02-10 20:21:52
问题 I'm working with Delphi (XE3) and need to connect to a MySQL database. I'm having a strange problem that seems quite common but I still haven't entirely solved this problem. traditional solutions include: setting "Update Criteria" to adCriteriaKey. ensure your table has a primary key (and tell the ADO Table about it) problem 1: start the application, execute the code: if the new value happens to match what's already in the database, I get the error at position "B". problem 2: start the

How to select from excel table with left join in access database - EXCEL VBA

一曲冷凌霜 提交于 2021-02-07 22:43:13
问题 i'm having difficult to create on query with two different database in ADO, i need to make a lot of queries with different sources, for example select from excel file with left join in access file. When i use two different excel files like the code below works fine. Dim SQL As String Dim CN As New ADODB.Connection Dim rs As New ADODB.Recordset Set CN = New ADODB.Connection Set rs = New ADODB.Recordset 'Open connection CN.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=C:\ExcelTable

How to select from excel table with left join in access database - EXCEL VBA

有些话、适合烂在心里 提交于 2021-02-07 22:41:59
问题 i'm having difficult to create on query with two different database in ADO, i need to make a lot of queries with different sources, for example select from excel file with left join in access file. When i use two different excel files like the code below works fine. Dim SQL As String Dim CN As New ADODB.Connection Dim rs As New ADODB.Recordset Set CN = New ADODB.Connection Set rs = New ADODB.Recordset 'Open connection CN.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=C:\ExcelTable

Get an unsorted recordset from ADO

落花浮王杯 提交于 2021-01-29 22:07:11
问题 I'm using ADO to get from excel file the table header column names. The problem is the data is returned sorted. I need it in it's original order. This is the code: _RecordsetPtr pSchema->m_pCon->OpenSchema(adSchemaColumns); // pSchema->Sort = ""; // Does not help // pSchema->Sort = "ORDINAL_POSITION"; // Crashes while (!pSchema->GetadoEOF()) { string sheetName = (char*)(_bstr_t)pSchema->Fields->GetItem("TABLE_NAME")->Value.bstrVal; if (sheetName == "MySheet") string column = (char*)(_bstr_t

Inserting data into xml file

不羁的心 提交于 2021-01-29 18:56:28
问题 I want to update connection string into xml file whenever new customer is registered with the website with its details in asp.net core 3.1 My connection string format is <ConnectionStrings> <add name="myConnectionString1" connectionString="server=localhost;database=myDb1;uid=myUser1;password=myPass;" /> <add name="myConnectionString2" connectionString="server=localhost;database=myDb2;uid=myUser2;password=myPass;" /> </ConnectionStrings> I want to achieve this using c# code so on registration

ADO recordset crashes while evaluating EOF after Excel upgrade

风格不统一 提交于 2021-01-29 16:22:16
问题 I have an Excel sheet that connects to a Basis database using an ODBC connection. It worked fine when we were running Excel 2010 on Windows Server 2008, but then we upgraded to Excel 2016 on Windows Server 2016, and it doesn't work anymore. Here's some code that demonstrates the problem: Public Sub cnntest() Dim cnn As ADODB.Connection Dim sql As String Dim rs As ADODB.Recordset Set cnn = New ADODB.Connection cnn.Open "DSN=redacted;UID=redacted;PWD=redacted;" sql = "SELECT ITEM FROM IC_ITM

MS ACCESS 2013-2016 continuous form shows error when adding any record past the 3rd when connected via ADO to SQL SERVER. Can this be fixed?

懵懂的女人 提交于 2021-01-28 19:08:30
问题 MS ACCESS 2013-2016 continuous forms show an error when adding any record past the 3rd. I have connected via ADO to SQL SERVER. I have been working on this issue for days. I am hoping there is something I can modify in my connection string, use a different library, or anything I can do in VBA to avoid building multiple workarounds in a project that has existed and grown over 20 years. Is this a known issue? Can this be fixed? Link to Continuous Form Showing Error This is the form code I am

MS Access 2019 - SQL Server 2017 - Recordset cannot be updated

耗尽温柔 提交于 2021-01-27 19:30:14
问题 I've created a table in a SQL Server 2017 database. Then I've created a form in MS Access 2019 that use an ADO Object as "record source". On the form, there is a Textbox with the controlsource property=Field. Then, when I open the form, everything works as expected (the content of Field shows up in the Textbox, I can move the cursor backwards and forwards and so on) except for one thing: It's not possible to change, add or delete records. Create a table On SQL Server (use SSMS): CREATE TABLE

Using sql-server datetime2 with TADOQuery.open

天涯浪子 提交于 2021-01-27 11:47:29
问题 I want to start using datetime2 fields in SQL Server and I need to insert into the tables via ADO from Delphi XE5. I am using TADOQuery.ExecSQL to insert and everything works fine. However most of my tables have identity columns, e.g. id integer identity(1,1) not null To save round-trips to the server, I usually use Open with two commands in the query text. The first command is the insert the second command is "select scope_identity() as scope_id" so I can retrieve the newly inserted id in