ms-access

MS Access - How do I display two fields from separate records on the same line based on their ID and Date?

Deadly 提交于 2020-01-13 18:19:21
问题 I don't know if this is even possible or perhaps my database is designed poorly and I could have done it a better way? Anyway here goes, I have database with two tables as follows " General Data " and " Assessment Data " - they're set up so that a patient can have a few basic details entered into "General Data" and then each time they have an assessment they have data relevant to that assessment entered into the "Assessment Data" table Sorry about the dodgy formatting! Not enough reputation

Opening Access database in exclusive mode

只谈情不闲聊 提交于 2020-01-13 17:58:10
问题 I'd like to be able to write a script that opens a Access database in exclusive mode so I can refresh the information in it without worrying about other users accessing the database in an inconsistent state. Is there a way to do this using VBA, or through a COM interface using VBScript? 回答1: According to this table of OLEDB init properties, you should add a "Mode=Share Exclusive" to your connection string. 回答2: I didn't know what should happen if any users have the database open when your

Opening Access database in exclusive mode

旧街凉风 提交于 2020-01-13 17:57:25
问题 I'd like to be able to write a script that opens a Access database in exclusive mode so I can refresh the information in it without worrying about other users accessing the database in an inconsistent state. Is there a way to do this using VBA, or through a COM interface using VBScript? 回答1: According to this table of OLEDB init properties, you should add a "Mode=Share Exclusive" to your connection string. 回答2: I didn't know what should happen if any users have the database open when your

Opening Access database in exclusive mode

喜你入骨 提交于 2020-01-13 17:57:05
问题 I'd like to be able to write a script that opens a Access database in exclusive mode so I can refresh the information in it without worrying about other users accessing the database in an inconsistent state. Is there a way to do this using VBA, or through a COM interface using VBScript? 回答1: According to this table of OLEDB init properties, you should add a "Mode=Share Exclusive" to your connection string. 回答2: I didn't know what should happen if any users have the database open when your

MS Access (Jet) transactions, workspaces

假装没事ソ 提交于 2020-01-13 11:58:19
问题 I am having trouble with committing a transaction (using Access 2003 DAO). It's acting as if I never had called BeginTrans -- I get error 3034 on CommitTrans, "You tried to commit or rollback a transaction without first beginning a transaction" ; and the changes are written to the database (presumably because they were never wrapped in a transaction). However, BeginTrans is run, if you step through it. I am running it within the Access environment using the DBEngine(0) workspace. The tables I

Undefined function 'Nz' in expression

我的梦境 提交于 2020-01-13 08:48:31
问题 I've Googled this error and haven't drawn up a conclusion to why I'm receiving this error. I'm trying to fill a DataGridView with some data. Here is my code. Private Sub LoadGrid() Dim cmd As New OleDbCommand Dim dt As DataTable With cmd .CommandText = "project_master_query" .CommandType = CommandType.StoredProcedure .Connection = New OleDbConnection(My.Settings.cnnString) End With dt = GetData(cmd) dgvData.DataSource = dt End Sub Private Function GetData(ByVal cmd As OleDbCommand) As

Adding a percent column to MS Access Query

跟風遠走 提交于 2020-01-13 06:49:09
问题 I'm trying to add a column which calculates percentages of different products in MS Access Query. Basically, this is the structure of the query that I'm trying to reach: Product | Total | Percentage Prod1 | 15 | 21.13% Prod2 | 23 | 32.39% Prod3 | 33 | 46.48% Product | 71 | 100% The formula for finding the percent I use is: ([Total Q of a Product]/[Totals of all Products])*100, but when I try to use the expression builder (since my SQL skills are basic) in MS Access to calculate it.. =

MS Access INSERT INTO statement

。_饼干妹妹 提交于 2020-01-12 23:17:44
问题 I need to insert form data from my VB.NET application to a Microsoft Access database. I am getting the error "Syntax error in INSERT INTO statement" when using the following syntax: INSERT INTO bs1 (teacher, subject, date, period) VALUES ('test', 'test', 'test', 'test') I'll admit I'm used to the MySQL type syntax, any help on this matter would be greatly appreciated, thanks. 回答1: I believe date is a reserved word. You need to encapsulate the reserved field names in square brackets: INSERT

MS Access INSERT INTO statement

最后都变了- 提交于 2020-01-12 23:15:01
问题 I need to insert form data from my VB.NET application to a Microsoft Access database. I am getting the error "Syntax error in INSERT INTO statement" when using the following syntax: INSERT INTO bs1 (teacher, subject, date, period) VALUES ('test', 'test', 'test', 'test') I'll admit I'm used to the MySQL type syntax, any help on this matter would be greatly appreciated, thanks. 回答1: I believe date is a reserved word. You need to encapsulate the reserved field names in square brackets: INSERT

List Box multiple value selection

≯℡__Kan透↙ 提交于 2020-01-12 11:42:29
问题 I have created form based on query output. I had used three comboboxes and one list box. First combobox gives me list of Dept, selection of Dept on second gives me location of that Dept (distinct), the third gives me (distinct) project from that location, then next is list box who displays the some codes of that project. The problem is I am able to select only one code from that list and get output in Excel. If I wanted to select two values at a time, how would I do that? If I select Multi