ms-access-2010

MS Access: Save form data to 2 tables at the click of a button

一个人想着一个人 提交于 2019-11-30 09:08:53
问题 I am creating an asset management database with 2 tables (Assets and AssetMovements) and one form (Assets). I need to keep records of every asset movement, so every time a new asset is added to the Assets table or the 'Location' value for an existing asset record is modified, the record should be saved to the AssetMovements table. The AssetMovements table is just there to record the transactions. How can I achieve this? I would be grateful for any pointers I can get, or if anyone can suggest

Random sorting query Access

旧时模样 提交于 2019-11-30 09:07:00
问题 I'm using this simple query to use a random sorting on a ms-access database: SELECT pk FROM TABLE ORDER BY Rnd(pk) asc And it's working fine when i test it with Microsoft Access 2010 However, when i call this query using classic asp, random sorting doesn't work. Here's my code: set Rs = Server.CreateObject("ADODB.Recordset") Rs.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/dbfolder") & "\dbname.mdb" Rs.Source = "SELECT pk FROM TABLE ORDER BY Rnd(pk) asc

Text-search in properties Access objects

不想你离开。 提交于 2019-11-30 07:15:08
问题 Is there a way in Access to search for a certain text in object properties and so on? Just not only in the VBA source code. I'm asking this because if I change for example the name of a field in a table I've to check a lot of object properties (Record Source, Control Source, Order By, ...). This can be done by trail-and-error or by checking all properties of each control of the forms, but that takes a lot of time. One option is the Find and Replace tool (nice tool!), but it's a bit of

How do I keep the necessary decimal places when using the DoCmd.TransferText command to export a table to a .csv?

时光总嘲笑我的痴心妄想 提交于 2019-11-30 06:01:49
问题 I am using the DoCmd.TransferText in MS-Access-2010 VBA to export a table to a .csv file. However when I do this the resulting .csv file truncates the information in the table. For example the longitude -85.350223 becomes -85.35. How do I make it where the resulting .csv file is still comma delimited and keeps the full information from the table? If I need to create an Import/Export specification and reference it in the command line using the SpecificationName feature of DoCmd.TransferText

How to Continuously Develop and Deploy an Access 2010 Database Application

橙三吉。 提交于 2019-11-30 04:28:02
问题 I've been developing an Access 2010 Database Application, let's call it Skill.accdb . I'm at the stage where I want to start deploying it so users can start using it and continue developing at the same time. I've been reading MSAccess-Deployment-Best-Practices, Deploy-an-Access-2007-application, and Ways-to-share-an-Access-database which talk about splitting, compiling, installing, etc., but they're very short on actual procedural steps to follow. I have split my database application into a

Access 2010 VBA query a table and iterate through results

强颜欢笑 提交于 2019-11-30 03:31:05
I have a query that I want to execute against a table. With the results I want to do something. In my head the pseudo code is: var q = "select * from table where some condition"; var results = db.getResults(q); foreach (row r in results ) do something with result How would I so something similar with vba? DAO is native to Access and by far the best for general use. ADO has its place, but it is unlikely that this is it. Dim rs As DAO.Recordset Dim db As Database Dim strSQL as String Set db=CurrentDB strSQL = "select * from table where some condition" Set rs = db.OpenRecordset(strSQL) Do While

Create a concatenated list of child table values from an Access database without using VBA

大兔子大兔子 提交于 2019-11-29 18:04:19
I have an Access 2010 database with a relationship between parent and child tables. I would like to be able to query the database from an external application and show values from the child table as a concatenated list of values in a single column, similar to what MySQL can produce with its GROUP_CONCAT() function. This has been asked here many times before, e.g., here: Combine values from related rows into a single concatenated string value but those solutions rely on a custom VBA function that is not available to external queries. Is there a way to make such a concatenated list available to

get column names from a table in an Access database using VB.NET

穿精又带淫゛_ 提交于 2019-11-29 17:43:26
How can I get all column names from a table in an Access database using VB.NET? With some articles on the Internet that I've tried, the result given is just the database schema. Is there any solution for this? You need to pass the name of the collection you are interested in to the GetSchema method. In the case of the columns collection, you also need to pass in an array of strings to filter the returned values. Dim connectionString = csb2.ToString Dim tableName = "Sales Reports" Dim filterValues = {Nothing, Nothing, tableName, Nothing} Using conn = New OleDbConnection(connectionString) conn

ADODB query timeout

不羁岁月 提交于 2019-11-29 17:34:58
问题 I am trying to open a query, which is timing out. I have tried setting the timeout property, but it doesn't seem to want to accept it. The query takes 34 seconds to execute using MS-SQL Server Management window (SQL Server 2005), so I know I need to increase the timeout. Current code: Public Function retRecordSet(StrSQL) Dim cmd ' as new ADODB.Command Dim rs 'As New ADODB.Recordset Set cmd = CreateObject("ADODB.Command") Set rs = CreateObject("ADODB.Recordset") cmd.ActiveConnection =

SQL Split column based on 1 or more possible delimiter and insert in new table

佐手、 提交于 2019-11-29 17:33:13
I m currently working on a SQl in MS-Access 2010 that can split a column based on a delimiter(,). In the column where I want to split on can have zero, one, two or three delimiter. I found out how i can split the column if there is only one delimiter (see SQL at the end of the question) but not if there are multiple delimiters. The SQL is based on the following table. This table is filled with possible data that can occur in the table. ID column_value --------------------- 1 2, 44 2 1 3 8, 9, 4 4 7 I want to split the column "value" in a way that i create a new table like this. It is not a