jet

Link SQL Server Table Into Access

那年仲夏 提交于 2019-12-11 12:20:09
问题 I found code here: Update linked tables in MS Access Database with C# programatically That will re-link a table, but how do you actually Link the table and change the name from what it is titled in SQL Server? I have gotten some pretty rough code started, but am getting hung-up on the parameters... Microsoft.Office.Interop.Access.Application docacc = new Microsoft.Office.Interop.Access.Application(); docacc.DoCmd.TransferDatabase(AcDataTransferType.acLink EDIT -- Access 2003 - and I want to

Excel Jet OLE DB: Inserting a DateTime value

不羁的心 提交于 2019-12-11 11:59:23
问题 OLEDB can be used to read and write Excel sheets. Consider the following code example: using (OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\my\\excel\\file.xls;Extended Properties='Excel 8.0;HDR=Yes'")) { conn.Open(); OleDbCommand cmd = new OleDbCommand("CREATE TABLE [Sheet1] ([Column1] datetime)", conn); cmd.ExecuteNonQuery(); cmd = new OleDbCommand("INSERT INTO Sheet1 VALUES (@mydate)", conn); cmd.Parameters.AddWithValue("@mydate", DateTime.Now

Problem with unregistered Jet 4.0 on Windows 7 64 bit

微笑、不失礼 提交于 2019-12-11 08:54:42
问题 I am trying to run a program, running on the hard drive, that uses Microsoft Jet OleDB to open and get info from an MS Access database. The problem is that when I try to run the program Visual Studio gives me this error: "The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine." I tried building the program to target "x86" instead of "Any CPU", but that did not work. I also looked in the Windows\SysWOW64 folder (the 64 bit equivalent to Windows\System32 folder on a 32

Cannot close ODBC connections

折月煮酒 提交于 2019-12-11 05:54:32
问题 I use odbc_connect() to open a DSN-less connection with a Microsoft Access file under PHP/5.6.21 and write into the file: $conn = odbc_connect('DRIVER={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=D:\\Path\\To\\Output.mdb', '', ''); Apparently, both odbc_close($conn) nor odbc_close_all() destroy the resource but don't really close the connection. As a result: I cannot move or delete the file when I'm done because I get file is in use by another process error messages. I cannot write as many

SQL statement returns wrong values (TOP n … ORDER BY)

徘徊边缘 提交于 2019-12-11 05:08:13
问题 I tried to get the the last and next row of my table by using this query: SELECT TOP 1 Nummer FROM Empfänger WHERE Nummer < 4748 ORDER BY Nummer DESC UNION SELECT TOP 2 Nummer FROM Empfänger WHERE Nummer >= 4748 ORDER BY Nummer ASC; The primary key “Nummer” is unique and auto-incremental , so there is 4747, 4748, 4749 It should imho return the above stated numbers, but instead it returns: 4747, 4798, 4799 When I open the Database with Access and set the filter "between" the values are shown

Jet OLEDB Provider working everywhere except Excel 2010 on Windows 7 64-bit

前提是你 提交于 2019-12-11 04:46:33
问题 I'm using the "Microsoft.Jet.OLEDB.4.0" provider for a basic connection in some VBA code, and the code works everywhere except on windows 7 64-bit operating systems running a 64-bit installation of Microsoft Office Excel 2010. Literally every other combination of XP 32 or 64, Vista 32 or 64, and 7 32, with Excel 2003, 2007, or 2010 installations has no problem running this code, but on the above described system, it results in an error about a "Missing Provider" and I can't create the

Provider selection, when trying to access Excel table in Delphi 7

我与影子孤独终老i 提交于 2019-12-11 03:18:36
问题 I am trying to connect to excel table from Delphi 7 using TAdoConnection component. The problem is when I select Microsoft.Jet.OLEDB.4.0, Extended Properties="Excel 8.0;", I sometimes receive error, that external table is not in the expected format. When i select: Provider=Microsoft.ACE.OLEDB.12.0;Extended Properties=Excel 12.0; then some users receive following error: "Provider cannot be found. It may not be properly installed". Is there a way to solve my problem? 回答1: It's been too long

Adding to MS Access relationship diagram programmatically

浪尽此生 提交于 2019-12-10 23:59:18
问题 I have an application that ships to the customer with a JET database including a relationship diagram which more savvy users are invited to view to gain insight into the construction of the database. I also have code in my application to update the database structure when new versions require new tables, new columns, or modified queries. I do this by pushing SQL through the ADO connection it works fine. The problem is that if I add a new table with a constraint that relates it to an existing

How to combine two sql queries?

给你一囗甜甜゛ 提交于 2019-12-10 19:07:15
问题 I have a stock table and I would like to create a report that will show how often were items ordered. "stock" table: item_id | pcs | operation apples | 100 | order oranges | 50 | order apples | -100 | delivery pears | 100 | order oranges | -40 | delivery apples | 50 | order apples | 50 | delivery Basically I need to join these two queries together. A query which prints stock balances: SELECT stock.item_id, Sum(stock.pcs) AS stock_balance FROM stock GROUP BY stock.item_id; A query which prints

Accessing another password protected database in an SQL query in Access 97

故事扮演 提交于 2019-12-10 15:17:06
问题 I am currently working on an SQL query for Access 97. Given are the following tables (simplified for demonstration purposes), each of which are located in separate mdb files: Table1 in C:\db\db1.mdb: PartyId (PK) Name ------------ -------- 1 A 2 B 3 C Table2 in C:\db\db2.mdb: PartyId (PK) Date (PK) Value ------------ --------- ----- 1 6/30/2014 4 1 7/1/2014 8 2 5/3/2014 3 3 5/5/2014 5 3 5/3/2014 1 3 5/2/2014 2 Here I would like to look for the most recent value of each party, based on a