Case expressions in Access

You can use the IIF() function instead. IIF(condition, valueiftrue, valueiffalse) condition is the value that you want to test. valueiftrue is the value that is returned if condition evaluates to TRUE. valueiffalse is the value that is returned if condition evaluates to FALSE. There is also the Switch function which is easier to use and … Read more

What do I need to read Microsoft Access databases using Python?

On Linux, MDBTools is your only chance as of now. [disputed] On Windows, you can deal with mdb files with pypyodbc. To create an Access mdb file: import pypyodbc pypyodbc.win_create_mdb( “D:\\Your_MDB_file_path.mdb” ) Here is an Hello World script that fully demostate pypyodbc’s Access support functions. Disclaimer: I’m the developer of pypyodbc.

Show “Open File” Dialog

My comments on Renaud Bompuis’s answer messed up. Actually, you can use late binding, and the reference to the 11.0 object library is not required. The following code will work without any references: Dim f As Object Set f = Application.FileDialog(3) f.AllowMultiSelect = True f.Show MsgBox “file choosen = ” & f.SelectedItems.Count Note that the … Read more

Does VBA contain a comment block syntax? [duplicate]

Although there isn’t a syntax, you can still get close by using the built-in block comment buttons: If you’re not viewing the Edit toolbar already, right-click on the toolbar and enable the Edit toolbar: Then, select a block of code and hit the “Comment Block” button; or if it’s already commented out, use the “Uncomment … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)