ms-access

Access linked table - login without saving password

≡放荡痞女 提交于 2020-01-22 02:36:15
问题 I have an Access database which I am moving to an Azure SQL server back-end. I want the users to be able to use a custom form to set the details used for the linked tables. Currently I am using an AttachDSNLessTable to re-create the linked table with a users credentials however this saves the details to the Access file which isn't very secure. I thought about removing the linked tables during the DB close but if the task is killed the connection details will remain. Is there a way I can

MS Access OpenRecordset query

只愿长相守 提交于 2020-01-22 02:32:07
问题 Using MS Access, when I want to know the ID of the most recently added record, I use nNewID = CurrentDb.OpenRecordset("SELECT @@IDENTITY")(0) which I picked up from a posting on StackOverflow. Please can someone explain how this works? In particular, there doesn't seem to be any reference to the table that the record has been added to - so does @@IDENTITY refer to the last added record, whichever table it was added to? - also what is the role of the (0) at the end of the statement? Thanks for

Running sum in Access query with Group By

妖精的绣舞 提交于 2020-01-21 19:15:55
问题 I can't get a running sum to work in an Access query. I have a pipesystem, where I'm trying to summarize the flow Q, through the pipenetwork. I've been trying to do a running sum based on a group_by ID_downstream and a DSum on Q_total. However I keep getting errors or wrong input. The desired output, is that I can see the flow accumulated through the network as shown in the table and picture. 回答1: You have several options. One, however, won't do, and that is a recursive query using SQL only;

I want to combine/union two tables and have it create a field that identifies which table it came from

大城市里の小女人 提交于 2020-01-21 18:50:29
问题 I want to combine/union two tables and have it create a field that identifies which table it came from. I saw an answer for SQL but I do not need max values. I just need to Union two tables. Here is my current SQL for a union query I made through access' query. SELECT [TableA].[1As], [TableA].[2As] UNION SELECT [TableB].[1As], [TableA].[2As]; I want the tables to create whichtabl field and populate whatever word I tell it based on the the table it came from to look like this: Fields: 1As 2As

How to set the default value of an Access 2003 field using SQL?

依然范特西╮ 提交于 2020-01-21 12:09:10
问题 How can I set the default value for a field using SQL in MS Access? I tried this but got a syntax error: CREATE TABLE HELLO ( MUN INTEGER NOT NULL, ADD CHAR(50) DEFAULT'16 asd ST.' ) 回答1: The word ADD is a keyword. Try this: CREATE TABLE HELLO ( MUN INTEGER NOT NULL, [ADD] CHAR(50) DEFAULT '16 asd ST.' ) 回答2: The DEFAULT and CHAR keywords are only supported when in the ACE/Jet engine's ANSI-92 Query Mode (and then only in SQL DDL). As Jose Basilio points out, ADD is a reserved word and must

How to set the default value of an Access 2003 field using SQL?

谁说胖子不能爱 提交于 2020-01-21 12:09:05
问题 How can I set the default value for a field using SQL in MS Access? I tried this but got a syntax error: CREATE TABLE HELLO ( MUN INTEGER NOT NULL, ADD CHAR(50) DEFAULT'16 asd ST.' ) 回答1: The word ADD is a keyword. Try this: CREATE TABLE HELLO ( MUN INTEGER NOT NULL, [ADD] CHAR(50) DEFAULT '16 asd ST.' ) 回答2: The DEFAULT and CHAR keywords are only supported when in the ACE/Jet engine's ANSI-92 Query Mode (and then only in SQL DDL). As Jose Basilio points out, ADD is a reserved word and must

MS Access Query does not differentiate hiragana and katakana with standard equality operator

牧云@^-^@ 提交于 2020-01-21 09:44:17
问题 I recently ran into a problem with an MS Access query where I was searching a table containing Japanese text. Japanese has two alphabets, hiragana and katakana, with the same sound value, but different characters. For example, あ (hiragana) and ア (katakana) are both pronounced as 'a'. These two characters need to be treated as distinct for my SELECT query, but when I run the following query: SELECT [KeywordID] FROM [Keyword] WHERE [Keyword].[Keyword]="あ" It returns two values in my Keyword

What is the MS Access SQL syntax to create a field of type Hyperlink?

谁说我不能喝 提交于 2020-01-21 05:25:26
问题 I'm working on a C# project that uses System.Data.OleDb.OleDbCommand class to create and alter tables in an MS Access DB. I generate the SQL statement, pass it to the object, then call the ExecuteNonQuery function. I was able to figure out the proper MS Access SQL syntax to create columns of the following Access data types: AutoNumber: ALTER TABLE table-name ADD COLUMN column-name COUNTER|AUTOINCREMENT Currency: ALTER TABLE table-name ADD COLUMN column-name MONEY Date/Time: ALTER TABLE table

How do I prevent clicks on a subform causing updates on the main form

╄→尐↘猪︶ㄣ 提交于 2020-01-20 09:00:34
问题 I have a form in a booking system which contains a subform which is a replica of the old ActiveX calendar control that Access 2010 doesn't have anymore. One particular use is to create a new booking. This means the form is "sitting" on a new record. However I don't want that record written until I am sure that all the data is properly validated. However I have a little Gotcha. If the user clicks on the calendar to select a new date, my master forms Before_Update event fires - indicating that

How do I prevent clicks on a subform causing updates on the main form

ぃ、小莉子 提交于 2020-01-20 09:00:34
问题 I have a form in a booking system which contains a subform which is a replica of the old ActiveX calendar control that Access 2010 doesn't have anymore. One particular use is to create a new booking. This means the form is "sitting" on a new record. However I don't want that record written until I am sure that all the data is properly validated. However I have a little Gotcha. If the user clicks on the calendar to select a new date, my master forms Before_Update event fires - indicating that