Access-vba copy data Error - ms-access

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.

Related

update mysql from a sql file

Im new to the php and mysql. I have been coding an auto update script. Everything works fine as I can download the latest version files from my own host which includes of the sql file of mysql. All I want to do an update due to this sql file.
What I want this code to do is;
If there is new tables, add it to the mysql and if we have deleted 1 table it can check and delete the same table from mysql.
But while we are doing this update, we will have so many entries under columns so I dont want it to update the columns which has entries in it. But if this is a column that we have deleted from the source sql file then it will delete it.
If there is new column on the source sql file then it will add that column to the mysql.
Any possibility can help me? Try to find if I can find something similiar but I couldnt see. Thats why I opened a topic here.
Thank you very much

mysqldump restore issues

i am trying to create a backup of my db.
i have separated the schema and the data in two different sql files from mysql dump.
when i try to restore the schema works fine, but when i execute the data.sql file i get too many errors.
sql error
please check the link for the error
Your problem might be that you are trying to insert data into some columns which reference to another column which is not populated yet thereby the query is failing on integrity checks. I suggest you create one sql dump for both the schema and data and run it once. That may save you this headache.

JDBC:ODBC:Access "search key was not found in any record"

I have a Java Application that uses the JDBC:ODBC bridge for a connection with DBF Files linked to a Microsoft Access Database (thus, I'm using the driver for a connection to a Microsoft Access Database)
There is a table named SALFAC, that contains the following fields: NRO_FAC, COD_ITE, CAN_ITE, PRC_ITE and DSC_ITE among other columns. When I perform the following query: SELECT NRO_FAC, COD_ITE, CAN_ITE, PRC_ITE, DSC_ITE FROM SALFAC, without a WHERE clause it works fine. But when I execute the following: SELECT NRO_FAC, COD_ITE, CAN_ITE, PRC_ITE and DSC_ITE WHERE NRO_FAC=151407, my program throws a SQLException with the message The search key was not found in any record.
The NRO_FAC column is an integer type column, so using quotes results in a syntax error.
I compacted and repaired the entire database with no avail. Also, I tested the query directly on Microsoft Access 2010 and it gave me the same error. Yesterday I tested with another JDBC:ODBC bridge to the DBF files directly and also gave me the same error with the same query.
There is no blank spaces on the tables names and the columns names.
¿Is there any additional step to do in order to make queries like these work? I need execute the query with the WHERE clause. Also, for each DBF file is a NTX file. Must I do something with these files as well?
Thanks in advance
EDIT: I found something yesterday that might help. I changed the way I search the rows by inserting the entire DBF table content in an MS-Access temporary table, row by row, and then execute the query in the temprary table. It inserted the first 9 rows correctly, but the 10th row was next to a row that is marked as deleted and then the query crashed. Does the "marked-as-deleted" rows affect a query in MS-Access and/or dBase? If it does, is it possible ignore the "marked-as-deleted" rows using the JDBC:ODBC bridge? Also, must I install the Clipper commands (like DBU or PACK) in the server (it doesn't have them)?

Is it possible "Database Synchronization"

I have a problem and not sure if this is possible. My web application has a database and i'm using a mysql workbench and using wamp server.
My web app has a database name healthcare, and if I import again another database with the same tables, etc but addition data. I want the first database to be updated only with new values but not replaced.
Is it possible?
Edit: I searched in the net and other related sources and I manage to set my phpmyadmin "Ignore multiple statement errors". When I import the second database (.sql with same tables but with new data) it does not update the first database but the message is successful. Please help, I'll appreciate any help...
in the past ive searched for tools to do some similar database sync tasks - in my experience ive found that none are free & reliable.
have you tried writing some queries to do this manually?
first thing that comes to mind would be figuring out a key you can use to evaluate each row and determine if you should copy said record from database A to database B.
afterwards you could simply do an INSERT(SELECT)
INSERT INTO healthcare_DESTINATION.table (SELECT * FROM healthcare_SOURCE WHERE some_condition = 1);
obviously this is the simplified version - but i've done something very similar utilizing timestamps (eg only copy rows newer than the newest row in the destination table)
hope this helps

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.