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

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)?

Related

"WARNING: Error in the metadata of the table ..." on opening database

I'm getting a warning message like this when connecting to some databases:
Error in the metadata of the table tblCourses: table's row count in the metadata is 69 but 37 records have been found and loaded by UCanAccess. All will work fine, but it's better to repair your database.
The records in my database were not all retrieve. I didn't know row count is gotten from metadata?
Anyone who knows how to solve this bug?
It's not a bug. UCanAccess is simply reporting that the row count in the metadata does not match the actual number of rows in the table. This is apparently due (at least in part) to some carelessness in the coding of Access, since one way to recreate the issue is to insert and delete rows from a table in Datasheet View in Access itself.
If you want the warning to go away then just open the database file in Access and perform a "Compact and Repair Database" operation.

How to run append query from data macro MS Access?

I have 2 table, one is local named 'Client' and other is a linked table to MySQL DB in my web-server named 'ClientSql'.
When I insert data into the table Client, I want it to be insert into clientSql too. I try it with data macro (after insert), but it shows me an error saying
It's not possible in linked tables.
I have tried to create an append query successfully, and it works, but it just works if I execute it manually. My question is:
Is it possible to call it from a data macro? if is possible, can you show me how? If not, can you point me to a solution?
I'm not sure why you should be able to do it manually, but not via a macro. According to this link
http://dev.mysql.com/doc/connector-odbc/en/connector-odbc-examples-tools-with-access-linked-tables.html
you should be able to do it either way.
Another thought is to eliminate the local access client table and have the access program update the mySql table directly. However, if another program is accessing the client table at the same time, this could become tricky due to multi-user and locking situations.

how to remove null rows from column in mysql in order to move data to another db

I know there's information on this already but in my particular case the available resources I can find on it aren't working.
I'm trying to copy the data from a table in one database over to another table (also pre-existing) in another database. The table I'm trying to copy from contains null rows at the beginning which are preventing me from copying the data over because the second table will not allow null rows. I've tried deleting them, excluding them, including only the relevant rows, etc. Most of the stuff I've tried won't work with my particular version of mysql (syntax error). The specific error I'm getting when I try to move the data between databases is ERROR 1136.
mysql version: 5.5.41-0ubuntu0.14.04.1

java and mysql load data infile misunderstanding

Thanks for viewing this. I need a little bit of help for this project that I am working on with MySql.
For part of the project I need to load a few things into a MySql database which I have up and running.
The info that I need, for each column in the table Documentation, is stored into text files on my hard drive.
For example, one column in the documentation table is "ports" so I have a ports.txt file on my computer with a bunch of port numbers and so on.
I tried to run this mysql script through phpMyAdmin which was
LOAD DATA INFILE 'C:\\ports.txt" INTO TABLE `Documentation`(`ports`).
It ran successfully so I went to do the other load data i needed which was
LOAD DATA INFILE 'C:\\vlan.txt' INTO TABLE `Documentation` (`vlans`)
This also completed successfully, but it added all the rows to the vlan column AFTER the last entry to the port column.
Why did this happen? Is there anything I can do to fix this? Thanks
Why did this happen?
LOAD DATA inserts new rows into the specified table; it doesn't update existing rows.
Is there anything I can do to fix this?
It's important to understand that MySQL doesn't guarantee that tables will be kept in any particular order. So, after your first LOAD, the order in which the data were inserted may be lost & forgotten - therefore, one would typically relate such data prior to importing it (e.g. as columns of the same record within a single CSV file).
You could LOAD your data into temporary tables that each have an AUTO_INCREMENT column and hope that such auto-incremented identifiers remain aligned between the two tables (MySQL makes absolutely no guarantee of this, but in your case you should find that each record is numbered sequentially from 1); once there, you could perform a query along the following lines:
INSERT INTO Documentation SELECT port, vlan FROM t_Ports JOIN t_Vlan USING (id);

Reserved error (-1524)

I am upgrading some of my MS Access programs from 2003 to 2007 version. I have a variable stored "Public" in the main menu of a program. In another form, I write that variable to a record (the form is using unbound data). The VBA line "Rst![FieldName]=Forms![Main Menu].strUser" gives a RunTime error of 3000, Reserved error (-1524).
What the heck is going on???????
Thanks for any help given.
I encouteredthe error when updating an mdb split database (frontend backend) to Access 2010. The original mdb database used an internal linkage (an autoid number in one table linked to the same number defauted in a second table). I encountered the problem when trying to import the first table mentioned above. I could not import the table or copy-paste the table without getting the "Reserved error (-1624) error.
The solution was to import the other tables that imported ok without the problem into a new 2010 database, and then use a make table query to duplicate the problem table in the new 2010 version. The process preserved the auto id numbering, so the internal relationship is preserved in the new, updated database.
I did have the same problem and after look the records in one table discover that one record had language changed and was all in Chinese alphabet.
After delete the record no more error.
Looks like, in my case, the error was generated because the primary key was used to link to another table. I did a check after and manage to identify one record in the other table that do not exist in the main table (record I deleted).