ms-access

How to select from excel table with left join in access database - EXCEL VBA

一曲冷凌霜 提交于 2021-02-07 22:43:13
问题 i'm having difficult to create on query with two different database in ADO, i need to make a lot of queries with different sources, for example select from excel file with left join in access file. When i use two different excel files like the code below works fine. Dim SQL As String Dim CN As New ADODB.Connection Dim rs As New ADODB.Recordset Set CN = New ADODB.Connection Set rs = New ADODB.Recordset 'Open connection CN.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=C:\ExcelTable

How to select from excel table with left join in access database - EXCEL VBA

有些话、适合烂在心里 提交于 2021-02-07 22:41:59
问题 i'm having difficult to create on query with two different database in ADO, i need to make a lot of queries with different sources, for example select from excel file with left join in access file. When i use two different excel files like the code below works fine. Dim SQL As String Dim CN As New ADODB.Connection Dim rs As New ADODB.Recordset Set CN = New ADODB.Connection Set rs = New ADODB.Recordset 'Open connection CN.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=C:\ExcelTable

Get ID of Last Inserted Record - Access DAO, ODBC, SQL Server 2008 Identity Field

三世轮回 提交于 2021-02-07 19:46:00
问题 It's a very common question but I'm having trouble getting the ID of the last inserted record. I'm using DAO with ODBC linked tables to duplicate a record and it's child records. My tables are in SQL Server 2008 and have Identity fields for ID fields. Here's what I've tried so far. My first bit of code here results in error 3167, Record is Deleted. If I do a debug.Print the recordset actually contains 3 records. Dim r as DAO.Recordset, db as DAO.Database Set db = CurrentDb Set r = db

Get ID of Last Inserted Record - Access DAO, ODBC, SQL Server 2008 Identity Field

安稳与你 提交于 2021-02-07 19:45:06
问题 It's a very common question but I'm having trouble getting the ID of the last inserted record. I'm using DAO with ODBC linked tables to duplicate a record and it's child records. My tables are in SQL Server 2008 and have Identity fields for ID fields. Here's what I've tried so far. My first bit of code here results in error 3167, Record is Deleted. If I do a debug.Print the recordset actually contains 3 records. Dim r as DAO.Recordset, db as DAO.Database Set db = CurrentDb Set r = db

Problem with a MS Access query after a “Compact and repair” operation

佐手、 提交于 2021-02-07 19:42:12
问题 I have an Access application that use the classical front-end/back-end approach. Yesterday, the backend got corrupted for a reason I don't know. So I opened the backend with Access 2003 and access asked me if I wanted to repair the file, I said yes and it seemed to work. I can open the database see the tables contents and run most of the queries. However there is an access query that doesn't work with a specific where clause. Example : // This works in the original DB, but not in the

Databases: Migrate data between MS Access DB and MYSQL

梦想的初衷 提交于 2021-02-07 19:33:48
问题 I have 2 databases, one is MS Access DB from an old website, and the other one is MYSQL from the new Joomla+VirtueMart based website. I need to migrate existing products from MS Access to MYSQL. I thought of putting both on server and writing SQL queries in MYSQL workbench, untill I have a good script for that, but I'm very new to SQL, so I'd rather avoid that. I there a better way and more efficient for that? 回答1: You can always export to CSV and import that in MySQL. 回答2: you can use tools

Max Value for MSAccess Date/Time

白昼怎懂夜的黑 提交于 2021-02-07 18:34:15
问题 What is the largest (latest) date that can be represented in Microsoft Access? 回答1: based on http://bytes.com/topic/access/insights/601315-vba-data-types, it's December 31, 9999. 回答2: Valid date values range from -657,434 (January 1, 100 A.D.) to 2,958,465 (December 31, 9999 A.D.). Valid time values range from 0.0 to 0.9999, or 23:59:59. 来源: https://stackoverflow.com/questions/2791287/max-value-for-msaccess-date-time

How to use VBA to add new record in MS Access?

人走茶凉 提交于 2021-02-07 12:34:41
问题 I'm using bound forms for the user to update information on new or existing customers. Right now I'm using a Add New Record macro on the submit button (because I'm not sure how to add or save a new record through VBA). I added a before update event (using VBA) to have the user confirm they want to save changes before exiting the form. For some reason this is overriding the add record button and now users cannot add new record until exiting the forms. How can I use VBA to add new customer

How to use VBA to add new record in MS Access?

做~自己de王妃 提交于 2021-02-07 12:34:17
问题 I'm using bound forms for the user to update information on new or existing customers. Right now I'm using a Add New Record macro on the submit button (because I'm not sure how to add or save a new record through VBA). I added a before update event (using VBA) to have the user confirm they want to save changes before exiting the form. For some reason this is overriding the add record button and now users cannot add new record until exiting the forms. How can I use VBA to add new customer

MS Access equivalent of FOR XML PATH in T-SQL to list related values [duplicate]

时光怂恿深爱的人放手 提交于 2021-02-07 10:22:25
问题 This question already has answers here : Combine rows / concatenate rows (5 answers) Combine values from related rows into a single concatenated string value (1 answer) Closed 7 years ago . I Have a table as follows in access: MatterNO Description Amount FL069509 SMS R 50.00 FL069509 Call R 52.00 FL069509 Summons R 52.00 FL069509 Email R 5 420.00 FL069509 Letter R 0.12 NA076353" SMs R 123.10 NA076353" call R 0.53 NA076353" summons R 53.00 NA076353" email R 453.00 NA076353" letter R 4 530.00