ms-access

How to create Microsoft Access database in C# programmatically?

偶尔善良 提交于 2020-01-18 22:46:27
问题 How do you create a Microsoft Access database file in C# if it does not exist yet? 回答1: The simplest answer is to embed an empty .mdb / .accdb file in your program and write it out to disk. The correct answer is to use COM Interop with the ADOX library: var cat = new ADOX.Catalog() cat.Create(connectionString); Remember to generate your connection strings using OleDbConnectionStringBuilder . 回答2: Try: using ADOX; //Requires Microsoft ADO Ext. 2.8 for DDL and Security using ADODB; public bool

Pass VBA Variable into Access Query(Excel VBA)

不想你离开。 提交于 2020-01-17 14:59:28
问题 Im new at trying to construct queries out of vba. I am trying to figure out how to pass a variable inside the VBA syntax. Mind showing me where im dumb? I tried this below but there's an automation error that pops up. Ive noticed from playing aroudn that automation errors come up when youve just got syntax wrong, so hopefully its something small? Any help is greatly appreciated Sub GetDataFromAccess() Dim cmd As New ADODB.Command, rs As ADODB.Recordset Dim recordNum As Integer recordNum = 7

Pass VBA Variable into Access Query(Excel VBA)

好久不见. 提交于 2020-01-17 14:58:12
问题 Im new at trying to construct queries out of vba. I am trying to figure out how to pass a variable inside the VBA syntax. Mind showing me where im dumb? I tried this below but there's an automation error that pops up. Ive noticed from playing aroudn that automation errors come up when youve just got syntax wrong, so hopefully its something small? Any help is greatly appreciated Sub GetDataFromAccess() Dim cmd As New ADODB.Command, rs As ADODB.Recordset Dim recordNum As Integer recordNum = 7

MS Access Creating a New Order And Orderline

為{幸葍}努か 提交于 2020-01-17 13:38:06
问题 I have a Customer table, an Order table, an Orderline table and a Product table. All of them have an Autonumber field as their primary key, and Orderline has a foreign key reference to Order ID on Order table: ORDER ----- Order ID - Autonumber Customer ID - Number ... ORDERLINE --------- OrderLine ID - Autonumber Order ID - FK to Order Product ID - FK to Product Quantity PRODUCT ------- Product ID - Autonumber Product details... I have a form where I can choose a customer, and then a list of

Problems by using two Access Runtime 2003 and 2010 in windows 7 64bits

北城余情 提交于 2020-01-17 09:05:38
问题 Environment: Windows 7 64bits Runtime Access 2003 32bits Runtime Access 2010 32bits We need to install 2 access runtimes in Windows 7 64bits, versions 2003 and 2010 because we are using databases of these two databases. I updated a pc from a Windows XP that worked out well, and now with this windows 7 there is any way to make this work. It works when I install each of them separately but when they are both installed together, there is no way. The last runtime I install, it is the database

Receiving values back after calling a sub in Access through .NET

浪尽此生 提交于 2020-01-17 07:45:18
问题 I am creating an C# application that must call subs in an Access mdb database file. I've created a test sub in the mdb file and I can call it from C# and also pass it parameters. That all works fine, but I want to pass a result back to C#. I know I can't do this with a function, so is it possible to pass the variables by reference, then vba can change the variables and I get my result back? I tried the following, but it doesn't work. Anybody know if this is possible? Thanks VBA test sub: Sub

Copy from Excel into Access using VBA -dynamic columns

痴心易碎 提交于 2020-01-17 06:20:11
问题 I have an access database where users are supposed to copy from Excel and import into an Access table. The users can select from several "imports", and they can create new imports themselves. Once they have selected an import - a query is created on the fly with the required columns to be imported into the table. All imports will populate the same table, but not all columns are relevant for each import. So if Import1 is selected, then the query will display eg. column2, column3 and column4.

Database lookup for each value of another database lookup

别来无恙 提交于 2020-01-17 06:16:30
问题 I am not sure how to exactly word this as I have just started SQL and have just finished going over simple joins. Ill start with my tables first: tblQuestions | Survey ID | User ID | Entry Date | Question 1 | Question 2 | Question 3 | Question 4 | | 1 | 305 | date | 0 | 1 | 2 | 3 | tblValues | VID | TextValue | | 0 | Never | | 1 | Rarely | | 2 | Sometimes | | 3 | Often | I want an SQL query that outputs the TextValues of each questions VID. I can't store the text values directly because the

Access SQL Server Insert blocked by Select

余生长醉 提交于 2020-01-17 05:46:06
问题 OK we have a multi user (25 users) Access 2013 FE and a SQL Server 2012 BE. Up until yesterday the whole system was working FINE and now it has completely stopped. If user A has a record open via a straight forward select query reading from TABLE Z, then if user B tries to do an insert on TABLE Z, they receive a timeout message. When I go to SQL server and run SP_WH02, it states User B is blocked by User A. When I then investigate the command that is blocking user B, it is just a simple

Access VBA not recognizing range in Excel spreadsheet

拜拜、爱过 提交于 2020-01-17 05:08:11
问题 I am having a most frustrating time time with the DoCmd.TransferSpreadsheet method. I have a workbook with multiple worksheets in which users are updating data and I have a script that puts all the records back into a single sheet, links the spreadsheet, and updates the data in my Access DB. My problem is in the Range parameter. I pass the following string and get the following error: DoCmd.TransferSpreadsheet TransferType:=acLink, SpreadsheetType:=acSpreadsheetTypeExcel12Xml, _ TableName: