ado

Modify main window's locale after user changes settings in Control Panel->Regional and Language Options

丶灬走出姿态 提交于 2019-12-23 03:56:12
问题 INTRODUCTION AND RELEVANT INFORMATION: I have MS Access 2007 database which I fill using ADO . Among other data types ( string , integer ...) I also have a double . Since I work on Windows XP and use pure Win32 API to create GUI, I collect data from edit controls with GetDlgItemText API and then I convert that text into double using _wtof_l . PROBLEM: Everything works well if the user sets English or Serbian ( we use European notation for decimal and group separator ) locale and then starts

How can I create user name and password protected MS Access 2007 file from C# and SQL?

好久不见. 提交于 2019-12-23 03:39:17
问题 I don't know much about OleDB and I need some information on how to create a MS Access 2007 file as password protected. This is a piece of code which use User Id=admin; Password= but it gives me an error while trying to save saying: Cannot start your application. The workgroup information file is missing or opened exclusively by another user. EDIT: Now I have error: Cannot open the MS Office Access database engine workgroup information file I have figured out that problems lay in the SQL

VBA - Change Outlook Subject Line on Receipt Of Email

瘦欲@ 提交于 2019-12-23 03:23:14
问题 I have written a script that's intended behaviour is supposed to change the Subject Line of a received email. This is because a Third Party Program monitors an Outlook Folder and posts it to a Virtual Cabinet based on the Subject line being a certain fashion. I have written the code below that all changes out OK however the Subject Line does not get changed - can anyone shed any light on this at all? Sub AmendSubject(myItem As Outlook.MailItem) Dim strBranch As String Dim strPolRef As String

ADO Database Table Boolean Column

扶醉桌前 提交于 2019-12-23 02:29:17
问题 I am having a bit of trouble with ADO. I have deployed a database application, which uses Access. With the release of different versions database tables have different fields, some added others deleted etc. What I can't get to work is how to add a BOOLEAN field in the database. For upgrade purposes I use the standart sql query component with a sql that looks like this : ALTER TABLE XXX ADD COLUMN YY BOOLEAN while this works for other data types, such as VARCHAR, INTEGER, DOUBLE etc, it does

Calculated column in wrong position when using `SELECT *`

旧城冷巷雨未停 提交于 2019-12-23 02:16:08
问题 Consider this query that uses SELECT * and 'appends' a calculated column: SELECT *, IIF(TRUE, 1, 0) AS calculated_col FROM Orders; I would expect calculated_col to be the rightmost column in the resultset. However, it is in fact the leftmost column. It is the rightmost when executing the equivalent query in SQL Server, for example. Now, because this is Access (ACE, Jet, whatever), the SQL Standards don't apply and the Access Help will not specify the expected result because it is not detailed

SQL Server optimistic locking - Returning changed timestamp value

六眼飞鱼酱① 提交于 2019-12-22 10:48:35
问题 I have an update stored procedure that implements optimistic locking. The stored procedure looks like this: ALTER PROCEDURE [dbo].[usp_Test] @Id AS char(2), @recordTimestamp as timestamp ... BEGIN UPDATE XY .. WHERE ((Id = @Id) AND (recordTimeStamp = @recordTimestamp)) if @@rowcount = 0 begin RAISERROR ('this row was changed by another user', 18, 1) end SELECT timeStamp from XY where Id = @Idend Is there a simpler way to return the new timestamp? I would really like to avoid the SELECT

How to automatically initialize / uninitialize something globally for every thread?

别说谁变了你拦得住时间么 提交于 2019-12-22 09:53:42
问题 I have a unit with an initialization and finalization section. This unit contains a complex object which is instantiated in the initialization and destroyed in the finalization . However, this object also contains an ADO Connection. That makes it an issue when using this across threads, because ADO is COM, and needs to be initialized for every thread. This is how I currently handle this global object instance: uses ActiveX; ... initialization CoInitialize(nil); _MyObject:= TMyObject.Create;

How to determine row count in SSIS dataset

和自甴很熟 提交于 2019-12-22 05:14:34
问题 I frequently encounter a situation in SSIS packages where I run a SQL Command to return a set of rows from an ADO connection. There are cases where I want to branch based on the number of rows returned. The ado resultset is stored in an SSIS 'object' datatype. Is there a way in SSIS expression or Script component to get that count of rows? 回答1: Instead of using the Execute Sql task, use a dataflow task like this. Use a source component to retrieve your data Use a rowcount component to store

Incorrect syntax near the keyword 'with' (SQL)

孤街醉人 提交于 2019-12-21 20:59:56
问题 I have a little bit of an odd issue. When I run this SQL: with ID_Table as ( select row_number() over (order By SS_ID) As row_id, ss_id from slide_show ) select t0.* from ID_Table as t1 inner Join slide_show as t0 on t1.ss_id = t0.ss_id where t1.row_id between 0 and 1 order by t1.row_id asc; in SQL Express, it runs and returns the first row as it should (similar to the Limit 0,1 in MySQL). However, when I run this in delphi via the TADOQuery object, I receive the error in the title. I am

ADO SQL type cast Float to String (Excel)

本小妞迷上赌 提交于 2019-12-21 11:49:04
问题 How do I use the CAST in ADO to convert Float values to String? I tried SELECT CAST([Field] AS VARCHAR(20)) FROM ... and SELECT CAST([Field] AS STRING) FROM ... and always get an OLE Exception (Unknown error). The table column contains mixed numeric (right justified) and alphanumeric (left justified) values. If there are only alphanumeric values, the ADO query field type is String. I am using Delphi 2009 ADO and Excel 2010. 回答1: CAST is SQL-Server expression. use SELECT Field FROM... in