ms-access

Programmatically export query table from MS Access to Excel using C#

人盡茶涼 提交于 2019-12-25 02:33:01
问题 Today i have a software which downloads xml data from the web and exports it to a MS Access DB in appropriate tables. In MS Access DB i have created a query using the tables to make columns and rows as i want it to look like in Excel. When i right-click on my new query table, and chose Export to Excel, i'm able to create an Excel file from that query. Basically what i want to do is extend my software so that i can export the query to Excel programmatically with C#. How can i do this? --------

Dynamic SQL column names

守給你的承諾、 提交于 2019-12-25 02:29:45
问题 I have a query like: SELECT [Week 1].Product, [Week 2].Product, [Week 3].Product, [Week 4].Product, Sum([Week 1].Transaction_Amount), Sum([Week 2].Transaction_Amount), Sum([Week 3].Transaction_Amount), Sum([Week 4].Transaction_Amount) FROM [Week 2],[Week 3],[Week 3],[Week 4]; I have data for 70 weeks name [week 1] to [week 70] Is it possible to make [week 1],[Week 2],[Week 3],[Week 4] dynamic. (i,e) have a master table where I can have 4 week names like [Week 8], [Week 6], [Week 45], [Week 18

How to get my current user logon in MS Access forms

假装没事ソ 提交于 2019-12-25 02:28:25
问题 I have initial form logon to Validate user details to access my MS Access database. Now I have a requirement in another form, If I choose same logon user from a combo box then command button should be enabled in the form so how I validate my initial logon user who logged in with another form Textbox in my access db. So I researched about this but could not get the useful scenario - Can some please help me how I can acheive this details ..Thanks! 回答1: After the user completes her login, hide

Can't get AfterUpdate Macro to work

狂风中的少年 提交于 2019-12-25 02:25:30
问题 Hi I would like to automatically update the value of an attribute in a field in Access 2013 if another attribute in that field is edited. In the database backend I have selected the table I want to work on, and clicked on the AfterUpdate tab in the ribbon I enter these steps and save it, but nothing seems to happen when I update the DATE_OF_DEATH field and there is no error message generated, so I can't even debug the thing, I don't know whether the Macro is even been triggered or not, or if

Get maximum length of DataTable column character representation

夙愿已清 提交于 2019-12-25 02:19:47
问题 I have a table in an Access database and I'm trying to use C# to get the column names and the maximum length of the string representations of each column. That is, if the table looks like this: Name ID SysBP ------------------- Jerry 1234 108.1 Tim 123 140.6 Marge 6 99.0 Where the ID and SysBP columns are numeric columns, I want a DataTable object that contains the following information: ColumnName MaxCharLen ---------------------- Name 5 ID 4 SysBP 4 I have an OLEDB connection to the

Can I call a sql command parameter from another class?

眉间皱痕 提交于 2019-12-25 02:11:47
问题 I have 14 tables, with the usual sql common command parameters, insert, update etc. Beginners, like me, will have all the methods in the main class, like this... namespace TestApp { public partial class TestNamTxt : Form { private OleDbConnection myCon; public TestNamTxt() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { myCon = new OleDbConnection(); myCon.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C\:... Database2.mdb") myCon.Open();

Limiting query in MS Access in PHP

戏子无情 提交于 2019-12-25 01:55:09
问题 I`m rewriting an application that use MS Access as the database. I was able to connect and fetch data from tables, but how can I apply limit and offset like SELECT * FROM tablename LIMIT 10 0 ? 回答1: SELECT TOP 10 * FROM tablename Similar thread(no offset allowed in access) 回答2: In Access the syntax is TOP n ; select top 10 * from tablename 回答3: http://phplens.com/lens/adodb/docs-adodb.htm#ex8 is much better solution. You can modify it a bit to suit your needs. By default it return in html

select top 700 * from objectaer work only in sqlserver 2005 but 2008

不羁的心 提交于 2019-12-25 01:53:54
问题 how can I select the last 700 entry in my access databse? I'm using this private string strsqlcommandBeta = "select top 700 * from objectaer " + " order by objectdate desc" + " "; but I'm getting this error The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect. 回答1: The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect. Typically this is a

Using Win32::OLE to execute macro in Access 2007

不问归期 提交于 2019-12-25 01:49:59
问题 Currently I am trying to execute a macro in Microsoft Access through Perl OLE I am wondering how to properly make the call to run a macro. I have tried 1) $oDatabase -> DoCmd.RunMacro("Macro1"); 2) $oDatabase -> DoCmd -> RunMacro("Macro1"); But they throw me "Can't call method "DoCmd" on an undefined value" or "useless use of concatentation" Is this even possible to execute a DoCmd through Win::32 OLE? Any help would be greatly appreciated. Here is a complete code. It tries to look for the

SQL executes well in MS Access but not in C# when “Validation Rule” is set

泪湿孤枕 提交于 2019-12-25 01:49:26
问题 I am having a strange problem. I have written a query in MS Access which inserts a value perfectly in database when run from MS Access, but when same query is executed from C# then it shows the "Validation Text" as OleDbException and insert command fails. The "Validation Rule" is " @ .*" The column saves emails which should have one "@" and one dot "." after it. There is no problem when "Validation Rule" is removed and query is executed from C#. It only occurs when Validation Rule is set and