Access built-in functions like Year() and Date() are not recognized - ms-access-2013

I tried the simple query:
select Year ( #5/1/1990# );
It shows error dialog:
Not defined function "Year" in expression
Also, when I use Date() in the form it shows #NAME. I added it with expression builder in Access. What am I doing wrong?

There is a problem with the referenced libraries in your project.
Open the VBA Editor ("Database Tools"->"Visual Basic" in the Ribbon) there go to the menu "Tools"->"References". Check if there is any library marked with "missing". Reinstall those libraries or change their path by removing them and adding them using the "Browse" button.
Generally you should remove any library you do not actually use in your project.
If that does not help, remove all the libraries (if possible, some are built-in and can not be removed) and add them again.
After changing the libraries use the menu "Debug"->"Compile yourProject". That should show error messages if there are obvious problems with the libraries in the VBA code. It will however not detect any problems with expressions used in queries or Form-controls.
If none of the steps above helped fixing the problem. You could create a new Access database and then import all the objects from your old database into the new one unsing "External Data"->"Access" in the Ribbon.

I just renamed my database after dealing with my database not running any queries that had expressions. Try copying and renaming your database first.

Thank you for the posts. I tried a new empty database: simple table with a simple query and everyhting worked! I will create a new Database and copy my stuff into it.

I had a similar problem where all built-in functions stopped working in a database.
All the references checked out fine.
Accidentally, it resolved by renaming the database so I could restore an old version.
When re-opening the renamed database I was asked to make it trusted. After that, the built-in functions worked again.

Related

Build Data Table Error (DataTable could not be read)

As seen above, there’s some error with the building of data table… Any help here?
Error message is as follows:
Creating dtData2: Type ‘UiPath.Core.GenericValue, UiPath.System.Activities, Version=20.4.0.0, Culture=neutral, PublicKeyToken=null’ is not allowed here. See https://go.microsoft.com/fwlink/?linkid=2132227 for more information.
2nd upload as per requested:
You might be using a .xaml file from a newer version of Studio. The BuildDataTable seems to be picky about that.
I encountered that mysterious crash on our production system after some third party developers made some code changes. I noticed the version of UIPath generic object in my crash screen was 19.10.x.x, and I know our Production and Test/Dev systems are on v18.x.
I suspected they sent us code developed in a newer version of Studio, or copied and pasted remotely from their Studio to ours and it happened to work (at least the pasting). I got a complaint from the users that the robot didn't work so they'd just do it manually until it could be fixed.
To "fix", edit the .xaml in Studio. Find the Build Data Table in the Activities and created a new code block. Since the Build command is so simple, needing only the output dt field, that might be the easiest option. I reran it in debugging with the new "BuildDataTable" acitivity and it didn't throw the exception. [I probably could've downgraded the genericvalue version number in the .xaml file, but I was already in Studio.]
You can also use "findstr" to search for the BuildDataTable commands from the .xaml file. The findstr or egrep command can show you the version of the genericvalue UIPath is trying to stuff into the empty datatable on creation:
<ui:BuildDataTable DataTable="[DetailDT]" DisplayName="Details Data Table"
xs:element name="Change_x0020_Type_x0020_Index"
...
msdata:DataType="UiPath.Core.GenericValue, UiPath.System.Activities, Version=19.10.1.0,
One of the nicer "features" of UIPath is their use of a sort of open format .xaml file for all the code storage. Using findstr or egrep has really helped find hidden problems spread across our large collection of folders. Their xaml is not as easy as merging code written in autoIt3 or AutoHotKey, as they have graphic screen size elements and block number tags embedded in it, but at least all the graphical code blocks aren't completely locked away in some compressed or OLE format as would be tempting for software that works (only?) on Windows.
Check your UiPath.System.Activities version. I had the same error with a DataTable containing another DataTable as a column. Basic datatypeas as string and int were no problem, but a DataTable threw the error.
I updated UiPath.System.Activities to 20.10.4 (from 19 something) and it worked after that. Also tried with 21.10.4 and that works as well.

SSIS value does not fall within the expected range with OLE DB Datasource

I'm using Visual studio 2013 with update 3 and a collegue of mine with update 4 installed each. We are using the data dools for sql server 2014.
I've created a few DTS packages which my collegue updated so far it worked without problems.
But all of a sudden I get "value does not fall within the expected range" warning from the datasource and can't edit columns there,.. . I needed to recreate the datasource for the message to disappear again.
My question here is can it be that the appearance of additional columns in the table which the datasource accesses was the cause of this problem? (I've seen out of sync warnings for datadestinations whenever a destination table got new columns or lost columns, but this is the first time something changed for a source table).
Or can that problem have a completely different cause?
It has been a long while since I've worked on an SSIS project, but I do recall seeing this error as well.
My experience was that it was caused to the metadata of the input being out of date in a certain way, and what you describe as your suspicion fits with this.
The solution I found to avoid this was to be very specific on all my input components, selecting the exact columns I wanted rather than selecting all. I think in the end I actually changed them all to use hand written SQL queries rather than the GUI column selector.
Also I don't remember if this was the same error but a similar one: sometimes after a schema changing when trying to open a component the GUI would throw an error and not open but when I tried again it would have resolved the error.
Sorry I couldn't be more definitive in my answer but hopefully this information helps point you in the right direction.
I used a simple method and it is working fine. In the OLE DB Source Editor while I retained the same connection manager, changed Data access mode (from Table/View) to SQL command and used SQL command to select the required columns. Error message no longer appeared and I could see the column values....

Strange Behaviour in Tibco BE 5.0..help needed

I am new to Tibco Business Events and facing a strange issue in BE 5.0. This is what I am trying to do:
I have created a DB concept named INVENTORYCONCEPT and have created a corresponding event for the same.
I have set this event as default destination in my JMS channel. Now when I am trying to create the instance of INVENTORYCONCEPT by giving command like ‘Concepts.INVENTORYCONCEPT inventory’ the BE studio gives me error that “INVENTORYCONCEPT is not the part of Concept folder” .
PFA the screenshot of my project files.
So can anyone tell me that what I have missed here ?
PS: I tried the traditional methods of restarting thr studio and changing the workspace.
You need to give some name to the concept instance that you are creating. What you are doing right now is
Concepts.INVENTORYCONCEPT = null;
This is wrong. You need to do something like this
Concepts.INVENTORYCONCEPT inventory = null;
Its always recommended & advised that you clean and validate your project when any changes are made to the project.
If the error still persists, you can open the concept using XML Viewer in BE and check the relative path of the Concept there. The reason for this to happen is when you create a concept in a some folder and later move it to a different folder, sometimes the XML related to that concept doesn't change (usually when you drag and drop the .concept file instead of using the Refactor option). You can just change the relative path in the XML and it should work.
Sometimes weird errors also occur when your workspace gets corrupted. In such cases, changing the default workspace and importing the project in the new workspace does the job.

Using Statement removed when I save the project

I am new to C# and Enterprise Library and I ran into some weird behavior in the IDE that I was able to resolve, but I thought that it was strange enough that I wanted to get the reaction of other developers and perhaps benefit others.
I wanted to start out by using the Data Access blocks. Using VS2010 and NuGet, NuGet downloaded the data Access DLLS and set the references. However, every time I trued to type the following:
using Microsoft.Practices.EnterpriseLibrary.Data;
and then save the project, the line simply disappeared and then I would get a compile error suggesting that I was missing a reference when I tried to enter the following statement:
Database db = DatabaseFactory.CreateDatabase();
It didn't help when I tried to bypass the "using" statement by fully qualifying the object.
Finally, I resolved the issue by compiling using the full 4.0 Framework instead of the Client Framework.
My Visual Studio Environment is a bit screwed up, but so far the issue seems isolated to SSIS and SSRS. Is this behavior that others have experienced or is it my computer? It sure seems like unusual behavior to me.
This is not standard VS behaviour. Do you have the VS Power Commands installed? That has an option to remove unused usings on save.
On the Tools menu choose Options and scroll the left window, looking for PowerCommands. If it's there click that entry and then ensure Remove and sort usings on save is unchecked.
If you don't have that plugin installed it will be another plugin doing this.

LINQ to SQL - How to deal with changes to database

I'm fairly new to LINQ to SQL, so I could be missing something basic here.
I created a LINQ to SQL layer, generated all the dbml files etc., and created a LINQ query which worked fine. I then made a change to the database, and wanted to get that change reflected in the ORM layer. To do this, I deleted my ORM layer and created a new one (may not be the best way?).
Now my code is not able to see the datacontext object in intellisense and won't compile. I imagine this may be something simple, but I'd also like to understand the bigger picture of how to update the LINQ to SQL ORM layer when the database changes.
Yeah, you don't want to delete your whole DBML file. Open it in the designer, and delete the table that changed. Then drag'n'drop it again from the "Server Explorer" (in the view menu). This will load an updated copy of teh database...
Note that if server explorer is already open while you make the change to the SQL schema, you'll need to refresh server explorer so it has the latest versions.
The drawback to this approach is that if you do customizations to the table in the DBML, those need to be redone. This is an infrequent case for me.
I remember having this issue a bunch. The fix is simple, really. Rebuild your solution! The DataContext and other such classes are generated during a build.
Quite a headache - I wish the DBML tool did this for you when you closed it.
You can also use SQLMetal to update your DBML classes. Some people even write a script or batch file to automate the process.

Resources