ms-access

Event not Firing in MS Access VBA

本小妞迷上赌 提交于 2020-01-11 13:05:23
问题 I have a form in MS Access which has an image. The image has an Click event which opens a modal form. The modal form has an OK and Cancel button. When you click the OK button, an event is supposed to fire which tells the main form which button was clicked. (This is to simulate the DialogResult functionality in C#). However, the code in the event handler never runs. The modal form has the following in the general declarations: Public Event OnDialogBoxClose(NewRecordID As Long, DialogResult As

Event not Firing in MS Access VBA

谁说胖子不能爱 提交于 2020-01-11 13:05:08
问题 I have a form in MS Access which has an image. The image has an Click event which opens a modal form. The modal form has an OK and Cancel button. When you click the OK button, an event is supposed to fire which tells the main form which button was clicked. (This is to simulate the DialogResult functionality in C#). However, the code in the event handler never runs. The modal form has the following in the general declarations: Public Event OnDialogBoxClose(NewRecordID As Long, DialogResult As

Cannot display Greek characters .mdb file (PHP & ODBC)

依然范特西╮ 提交于 2020-01-11 12:49:05
问题 I am having problems displaying text from a column in an MS Access 2007 table which is in Greek. I am using PHP and $dbc = @odbc_pconnect("Driver={Microsoft Access Driver (*.mdb)};Dbq=$mdbFilename", $user, $pass); to read from a local .mdb file. I can successfully read the rest of the data in the DB which is in Latin characters. Greek characters get displayed as � when I echo the results. The html charset is properly set to utf-8. I've tried using utf8_encode with no luck. I've been searching

DMedian in access 2013, no values returned

半世苍凉 提交于 2020-01-11 12:45:07
问题 I have the following query in MS Access 2013 than does not return a Median value. The field IU is always NULL (blank) or 1. Column GM is a number formatted 0.0000 between -5 and 5 with NULL values in it occasionally. SELECT IU, DMedian("GM","tblFirst250","IU=1") AS MedianByIU FROM tblFirst250 WHERE IU = 1 GROUP BY IU; However, while attempting to debug this, when I use DAvg instead of DMedian I get an Average value. I got DMedian (because I understood that Access 2013 didn't have it) from:

Create Table Syntax Error - MS Access, SQL view

只谈情不闲聊 提交于 2020-01-11 12:37:30
问题 I keep getting CREATE TABLE Syntax Error, but I don't see the error! What is causing the error? My SQL: CREATE TABLE my_employee ( employee_id INTEGER PRIMARY KEY NOT NULL, first_name VARCHAR(25) NOT NULL, last_name VARCHAR(30) NOT NULL, address VARCHAR(10) NOT NULL, birthdate DATE, salary NUMERIC(8,2) DEFAULT 15000, marital_status CHAR(1) ); 回答1: Since your DDL statement includes DEFAULT , you must execute it with ADO. I loaded your statement into a string variable and executed it from

Decreasing a value with a named parameter doesn't change said value

浪子不回头ぞ 提交于 2020-01-11 12:33:26
问题 I want to decrease my urunadedi value in an Access database. I have the following code: cmd2.Connection = con; cmd2.Parameters.AddWithValue("@urunid", Convert.ToInt64(textBox1.Text)); cmd2.Parameters.AddWithValue("@hesaplam",Convert.ToInt64(textBox2.Text)); cmd2.CommandText = @"UPDATE Table1 SET urunadedi=urunadedi-@hesaplam WHERE urunadi=@urunid"; cmd2.ExecuteNonQuery(); But the value of the field urunadedi is not decreasing. Why is that and how can I solve that? For the benefit of non

Decreasing a value with a named parameter doesn't change said value

百般思念 提交于 2020-01-11 12:32:28
问题 I want to decrease my urunadedi value in an Access database. I have the following code: cmd2.Connection = con; cmd2.Parameters.AddWithValue("@urunid", Convert.ToInt64(textBox1.Text)); cmd2.Parameters.AddWithValue("@hesaplam",Convert.ToInt64(textBox2.Text)); cmd2.CommandText = @"UPDATE Table1 SET urunadedi=urunadedi-@hesaplam WHERE urunadi=@urunid"; cmd2.ExecuteNonQuery(); But the value of the field urunadedi is not decreasing. Why is that and how can I solve that? For the benefit of non

Decreasing a value with a named parameter doesn't change said value

◇◆丶佛笑我妖孽 提交于 2020-01-11 12:32:09
问题 I want to decrease my urunadedi value in an Access database. I have the following code: cmd2.Connection = con; cmd2.Parameters.AddWithValue("@urunid", Convert.ToInt64(textBox1.Text)); cmd2.Parameters.AddWithValue("@hesaplam",Convert.ToInt64(textBox2.Text)); cmd2.CommandText = @"UPDATE Table1 SET urunadedi=urunadedi-@hesaplam WHERE urunadi=@urunid"; cmd2.ExecuteNonQuery(); But the value of the field urunadedi is not decreasing. Why is that and how can I solve that? For the benefit of non

Fetching first name and last name

。_饼干妹妹 提交于 2020-01-11 12:16:31
问题 I have a data in tables as full name. These name contains "Last_Name, First Name Middle Name" I need to fetch first name, last name and middle name from full name and store them in different fields. For example, I have full names in table as - Williams, Robert K Winchester, Sam T I need to store them as FirstName Last_Name MName Robert Williams K Sam Winchester T I am doing it on some tables in Ms access. Can anybody please help me how I can achieve this. 回答1: Here's an attempt at a non-VBA

a database error :“No value given for one or more required parameters.”

爷,独闯天下 提交于 2020-01-11 12:09:32
问题 I have a data grid that I should insert its columns values to an access database but I have problem with command.ExecuteNonQuery(); My project is not finished just because of this error. Here is my code : for (int i = 0; i < (dataGridFactorRent.Rows.Count) - 1; i++) { string query = @"INSERT INTO tbl_RentFactor([ID],DateNow,customerName, objectName, objectNumber,unitCost,objectCost,paidMoney,restOfMonyy,customerID,DateBack) VALUES ("+ID+",'" + lbldate.Text + "','" + cmdCustomName.Text + "',"