adoconnection

ADO: Excel: Is it possible to open recordset on table name?

a 夏天 提交于 2020-03-21 06:22:51
问题 I have looked on the web but did not find any answer. So i am putting it here. Code snippet: ( where case 1 is not working.. ) _bstr_t strCnn(L"Provider='Microsoft.ACE.OLEDB.12.0';DataSource=C:\\Book.xlsx;Extended Properties=\"Excel 12.0 Xml; HDR = YES\""); hr = pConn->Open(strCnn, "", "", adConnectUnspecified); // success **LPCSTR strQuery = "select * FROM Table1"; // case1: Not working** LPCSTR strQuery = "select * FROM [Sheet1$]"; // case2: working LPCSTR strQuery = "select * FROM [Sheet1

Microsoft AlwaysOn failover solution and Delphi

会有一股神秘感。 提交于 2019-12-21 17:02:27
问题 I'm trying to make a Delphi application to work with AlwaysOn solution. I found on Google that I have to use MultiSubnetFailover=True in the connection string. Application is compiled in Delphi XE3 and uses TADOConnection . If I use Provider=SQLOLEDB in the connection string, application starts but it looks like MultiSubnetFailover=True has no effect. If I use Provider=SQLNCLI11 (I found on Google that OLEDB doesn't support AlwaysOn solution and I have to use SQL Native client) I get invalid

Microsoft AlwaysOn failover solution and Delphi

风格不统一 提交于 2019-12-04 07:12:34
I'm trying to make a Delphi application to work with AlwaysOn solution. I found on Google that I have to use MultiSubnetFailover=True in the connection string. Application is compiled in Delphi XE3 and uses TADOConnection . If I use Provider=SQLOLEDB in the connection string, application starts but it looks like MultiSubnetFailover=True has no effect. If I use Provider=SQLNCLI11 (I found on Google that OLEDB doesn't support AlwaysOn solution and I have to use SQL Native client) I get invalid attribute when trying to open the connection. The connection string is: Provider=SQLOLEDB.1;Password=

Is Delphi's TADOConnection thread-safe?

允我心安 提交于 2019-11-27 23:54:28
I'm writing a Delphi 7 application which needs to access the same SQL Server database from many different threads simultaneously. Can I use a single shared TADOConnection, or must each thread create their own? Blorgbeard, you must create, initialize and open a separate TAdoconnection instance for each of your threads. ADO is a COM-based technology. It uses apartment-threaded objects ,don't forget to call CoInitialize(nil). procedure TMyThread.Execute; begin CoInitialize(nil); try try // create a connection here except end; finally CoUnInitialize; end; end; No, it is not. ADO is a COM-based

Is Delphi's TADOConnection thread-safe?

末鹿安然 提交于 2019-11-27 04:43:23
问题 I'm writing a Delphi 7 application which needs to access the same SQL Server database from many different threads simultaneously. Can I use a single shared TADOConnection, or must each thread create their own? 回答1: Blorgbeard, you must create, initialize and open a separate TAdoconnection instance for each of your threads. ADO is a COM-based technology. It uses apartment-threaded objects ,don't forget to call CoInitialize(nil). procedure TMyThread.Execute; begin CoInitialize(nil); try try //

Ok to use TADOConnection in threads

一笑奈何 提交于 2019-11-26 22:03:20
问题 I have created an TCPip server application. The application has one global TADOConnection. This global ado connection is used both for main thread queries and also within threaded processes. Is this ok? Does the ADOConnection have built in mechanisms to handle multiple queries at the same time? My application works find in testing environments (2-5 connections). But deployed in a production environment I am getting "unexplainable" access violations at the point the TADOQuery linked to the