ms-access

Insert a Data Table to Access Database using c#

自作多情 提交于 2021-01-28 12:39:18
问题 I have tried few codes from my end to insert a DataTable inside a Access db. Below is the code: public void WriteToAccess(DataTable dt) { string strDSN = "DSN=MYDSN"; string cmdText="Insert into AccessTable (ColumnA,ColumnB,ColumnC,ColumnD,ColumnE,ColumnF,ColumnG,ColumnH) Values (@p1,@p2,@p3,@p4,@p5,@p6,@p7,@p8)"; using (OdbcConnection cn = new OdbcConnection(strDSN)) { using (OdbcCommand cmd = new OdbcCommand(cmdText, cn)) { cn.Open(); foreach (DataRow r in dt.Rows) { cmd.Parameters

MS Access - Convert rows values into columns values

杀马特。学长 韩版系。学妹 提交于 2021-01-28 12:37:06
问题 I need to convert following Table using MS Access: into How do I convert it? I am new to ms access 2016. I have looked into the solution provided in ACCESS/SQL Combining multiple rows with one column into one row and creating multiple columns. But not able to get the result I want in my case. 回答1: Here is the sql script which works on MS SQL server: create table #T (Project varchar(50),Asset varchar(50), OrderNo int) insert into #T (Project, Asset, OrderNo) values ('ABC','K11',3245) insert

How to Split a String and Store in MS Access table

雨燕双飞 提交于 2021-01-28 12:10:55
问题 I would like to be able to split a string of text that has been entered into a textbox on a MS Access form and store the split strings as separate records under the same field. This is the code I have so far, but I keep running into problems at every corner. I'm fairly new to this, but have been learning quickly. Any help is appreciated. Here is what I'd like to accomplish: If I enter the following text into a text box ("this is a sentence") and click submit. I would like each other the words

MS Access - Is there an easy way to duplicate field information of a form and its subforms?

余生颓废 提交于 2021-01-28 11:14:34
问题 I want to duplicate a form with 3 subforms - to explain it simple: imagine a recipe (main form: some general data; sub form 1: list of ingredients, sub form 2: instructions; sub form 3: prices; sometimes the recipes change only the type of flour, so I don't want to type everything again but just have the same form with a new uniqe ID and this one change in the ingredients list) duplicating the main form is easy, but the sub forms are empty. there are some ideas i found online, but it seems

Multi use of Access

◇◆丶佛笑我妖孽 提交于 2021-01-28 09:24:02
问题 We have a MS Application which is used by around 10 users at the same time. The performance is poor and they complain. Plus I have hard time to deploy a new version because some users let the Access opened during the night and the file is locked. Is there a way how to speed it up and deploy a new version? 回答1: We have 35 users using a front end Access with only forms and code connected to SQL database. There are 971 tables and views on that SQL server - you can use a different Access database

MS Access Query to find gaps in sequential numbers when numbers are stored in Short Text field

纵饮孤独 提交于 2021-01-28 09:14:02
问题 I have a table (tblParts) with a PartNumber field (Short Text) which stores 6 digit part numbers for parts belonging to several families. The families are denoted by the first 2 digits of the part number (00, 01, 02, etc). (NOTE: I did not create this table and am not able to change it at this time) I need to find gaps in the numbering in order to fill in unused part numbers. If I have a project starting that needs 6 consecutive part numbers in a specific family, I want to find the first

Hiding the navigation pane

谁都会走 提交于 2021-01-28 08:50:55
问题 OK, so I need to hide the navigation pane but struggling. I am using a module to hide it and have tried the following but to no avail: DoCmd.NavigateTo "acNavigationCategoryObjectType" DoCmd.RunCommand acCmdWindowHide I have also tried: DoCmd.SelectObject acTable, , False Neither are working - Any ideas? 回答1: try this: DoCmd.SelectObject acTable, , True DoCmd.RunCommand (acCmdWindowHide) if that doesn't work, use a table name that exists instead of skipping that second argument in docmd

Access 2016 (64bit) MSO (365) deployed database cannot run with any runtime avaliable

帅比萌擦擦* 提交于 2021-01-28 07:50:22
问题 I've made an application on an MS Access 2016 with 365 subscription and deployed an .accde file. When I try to open that file on another PC with runtime installed (tried with 2016 4288-1001 64bit and 2013 64bit) I get an error saying "Database you are trying to open requires a newer version of Microsoft Access". I know that are some issues related to runtime and 365, but some people said that using runtime 2013 solved their problem (but not mine). Anyone have a solution for this? 回答1: The

Remove a string inside a cell in MS Access

ぃ、小莉子 提交于 2021-01-28 07:12:22
问题 I want to delete a certain string in a cell in MS Access, whether in a column or in the whole table. I know that I can do this using plain old Find and Replace but in this case it is not economical for my thousand-row table. For example, remove all Unknown values from all columns. remove the string "dollars" from the values in column price ie. if the cell contains "34 dollars", it will just be "34". Can this be done in SQL and how? 回答1: Assuming your query will run within an Access session,

Translating MySQL Queries to MS Access

折月煮酒 提交于 2021-01-28 05:51:42
问题 I have a very old project which uses MySQL, which I am considering converting part of to MS Access. I'm running into problems with some of the more complex queries, and wondered if there is a reference which details the differences between Access's SQL and MySQL. For example, I have the following query: select P.PersonID, P.FirstName, P.MiddleName, P.LastName, PR.LastName as MarriedName, P.Born, LocID, PlaceName, City, County, State, Country from persons P left join relatives R on (R.Person =