NULL values on access - ms-access

When I copy row of my table and when I paste it all empty string values are replaced by NULL value.I try to uninstall acces and install I have the same problem.
For example here I copy/paste the same oh the same table on access and when I opened it with DBeaver software and there are NULL values
DBeaver data
Have you ever have this problem and how can I fix it ?

Related

Datetime error migrating MS Access to MySQL with Workbench

I am trying to migrate an MS Access database to MySQL Server using Workbench, but Workbench generates errors in the SQL CREATE script, which causes some tables to fail to be created. Most are of the following form:
Too-big precision 19 specified for 'TransDate'. Maximum is 6..
SQL Error: 1426
Referring to:
CREATE TABLE IF NOT EXISTS `dbName`.`tblName` (
`ID` INT(10) NOT NULL,
`TransDate` DATETIME(19) NULL,
`ClientID` INT(10) NULL,
...
As you can see, it also generates integer types with deprecated display width syntax, which is something I would like to avoid as well.
How can I make Workbench generate a script that avoids these problems?
EDIT
I am aware that the script can be manually edited in the Create Target Results stage; however there are many tables that have these errors, and I can't see any way to edit them with a text editor, so I am looking for a solution wherein Workbench generates the correct script automatically.
In the Manual Editing tab, I found an option to edit column mappings, which allows you to change multiple columns of the same type across the script all at once. Pick Column Mappings from the drop down window, and right click on a row that corresponds to the type you want to remap. Then choose 'Find and Replace Target Type' and provide the types you want to map.

Access-vba copy data Error

I am using access-vba to copy and insert the data into database, many of the data insert successfully, but some data missed. For example, I need to create a new baseline named version 16, and need to copy all the data from version 15 and insert into the same database and same tables under version 16. I have three tables [Baseline],[Sections],[CVELink], and I found the problem is in [CVELink]."runtime error 94, "invalid use of null"," and the debug shows me the problem is on this query
DoCmd.RunSQL sqlStatement
I don't know how to fix it. any help would be really appreciate.
I solved my problem. There are null columns in the table, I manage the database and change the code to handle the error if there is null in the database.

Deleting/Editing rows in MySQL ODBC linked table results in error in MS Access

I am using MS Access 2003 under Windows 7 (64bit), with external linked table at MySQL server (5.0.51a-24+lenny5), connected via MySQL ODBC connector (using 5.1.10, because the newest 5.1.11 is buggy). When I open this table in MS Access and try to delete some records from it, I get following error:
The Microsoft Jet engine stopped the process because you and another
user are attempting to change the same data at the same time.
When I try to edit some records in the table, I get following error:
This record has been changed by another user since you started editing
it. If you save the record, you will overwrite the changes the other
user made.
Copying the changes to the clipboard will let you look at the values
the other user entered, and then paste your changes back in if you
decide to make changes.
However, when I do it via deletion or update query in MS Access, it works fine! I just cannot delete the records directly from the table.
I found out (see the detailed analysis below), that the problem is present when there are double fields with values with a lot of decimal digits. See:
CREATE TABLE `_try4` (
`a` int(11) NOT NULL default '0',
`b` double default NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
insert into _try4 values (1, NULL),(2, 4.532423),(3,10),(4,0),
(5,6.34324),(6, 8.2342398423094823);
The problem is only present when you try to delete/edit the last record (a = 6), otherwise it is OK!
The issue is documented:
http://support.microsoft.com/kb/280730 , proposing these 3 workarounds:
Add a timestamp column to the SQL table. (JET will then use only this field to see if the record has been updated.)
Modify the data type that is in SQL Server to a non-floating point data type (for example, Decimal).
Run an Update Query to update the record. You must do this instead of relying on the recordset update.
However, these 3 workarounds are not satisfactory. Only first could be, but this workaround didn't work - as expected. It probably works only with MS SQL Server.
Are there any other solutions/workarounds for this problem?
Additional details:
The MySQL server is just for me, nobody else is accessing it.
Insertion of new records was working fine.
Primary key is well defined for this table.
Restart of MS Access didn't help.
Deleting the link to the ODBC table and linking it again didn't help either.
Linking the table from brand new Access database didn't help.
Changing the MySQL database engine from MyISAM to InnoDB didn't help either.
There is no problem with permissions, there are all permission for this user#host.
I can normally delete the records from the MySQL console at the server without problem.
Trying to set MySQL Connector ODBC options didn't help: Allow big results, Enable automatic reconnect, Allow multiple statements, Enable dynamic cursors, Force use of forward-only cursors, Don't cache results of forward-only cursors.
I turned on debugging in MySQL ODBC connector, it created myodbc.sql log, but it didn't contain any corresponding queries when editing/deleting (don't know why).
More details about the structure of the linked table would be helpful, but I'll hazard a guess.
I've had a similar problem in both MS Access 2003 and 2010 when I included nullable boolean fields in the SQL Server linked table. Seems JET databases have a problem with nullable nit fields. Check out this answer for more information: https://stackoverflow.com/a/4765810/1428147
I fixed my problem by making boolean fields non-nullable and setting a default value. If your problem is the same as mine, but with MySQL, try doing the same.
I solved here the same issue. The solution was to remove Default Values from decimal fields in the table. I was able to keep decimal data type but just remove the default value I already defined before with 0.0000 and now I set to null and bug fixed.
My workaround was to copy the table data into excel, then use phpadmin to clear the table, then do the editing in excel and copy the 'new' data (ie, all of it, after editing) back to access.

How to set a blob field to NULL

I have a table with a BLOB field that I sometimes want to set to NULL. If I edit a row in phpMyAdmin, I can set non-blob fields to NULL, but all I can do with a BLOB field is upload a file. If the field already has a value, the only way I have found to NULL it is to type in an SQL query. This makes each row update a two-step process, which makes it more error-prone (not to mention irritating).
I haven't found anything about this in the manual. If it makes a difference, I'm using phpMyAdmin version 3.3.8.1.
I also have been perplexed by the inability to set BLOB columns to NULL in phpMyAdmin. Luckily this seems to have been recently fixed: phpMyAdmin 3.4.1 happily lets you set BLOB columns to NULL.

When saving to a model, created and modified aren't automatically populated by CakePHP. Using SQL Server

Hi when saving to a model, my created and modified fields aren't automatically populated by CakePHP. It was automatically populated when I was using MySQL but now it isn't. I'm not using NOW() back when I was still using MySQL. Why is it? Also when a field's value is not set 'NULL' (with quotes) is inserted causing errors because SQL Server says I can't insert a string to a field of type smallint/date etc. How do I fix this?
Thanks in advance!
I would set NULL as a keyword rather than quoting it, which I imagine is why your database thinks that it's a string.
Have you double checked the schema of the database to ensure that the created and modified fields are still DATETIME fields.
Also you say "SQL Server", and mention MySQL, so I assume that you are now using MSSQL?