In the past month I've had two instances of this problem on different DBs at different companies. One was doing a transferspreadsheet (to excel) and the other was getting the same error anytime anything do to with the printers happened (print preview, or defining a new report, for example). This...
Posting this info to hopefully save someone the hours I spent resolving the problem!
The latest SP that brought us the "unsafe expressions" errors also disabled Access' ability to update a linked Excel workbook via query.
I had 2 excel sheets linked as tables, one the master and the 2nd...
Oh, it's just a simple insert:
$qry = "INSERT INTO tbl1(code, user, duty, seq,role, email) VALUES('$mycode',$uid,'$duty',$seq,'$_role','$_email')";
$db->query($qry);
The primary key column (proc_id) isn't mentioned in the query.
It works fine for months. Yesterday...
If you're using a language that allows you to handle the error you could just do the insert. If you get a duplicat key error you could handle it in whatever way is appropriate for tha application.
We usually do a select first (with the new key) and then check the number of fields returned. If...
Sorry, I meant getting out of sync in the other direction! Causing the "ERROR: Cannot insert a duplicate key into unique index tablename_pkey."
Thanks for the tip on the sort being faster than the search. In this case though, I was just manually resetting the seq so code that does inserts would...
I know how to fix the seq when it is out of sync with a table:
SELECT setval('tablename_seq',(SELECT max(tbl_id_col) FROM tablename));
My question: anyone know how they get out of sync in the first place?
The only code we have that inserts doesn't reference the id column, so PGsql should get...
I found (and fixed) a PHP class that handles all the functions you would ever need with CSV files. Used it a few times. Don't know if you were still looking...
Frank
Sometimes a Select DISTINCT ... will solve that. Sometimes you need to make sure you are matching on the key and its equivalent when you have more than one table (or join one to itself). Did you view the SQL to see if anything looks funny?
Frank
Here's the event for the receiving form. (Other code is required to handle new (filtered) records.)
Private Sub Form_Open(Cancel As Integer)
If Not IsNull(Me.OpenArgs) Then
Dim InID As Integer
Dim SQLwhere As String
Dim RS As DAO.Recordset
Set RS =...
Please excuse my symantics. If everything is still DAO, why do I have to go check the 3.x library to use it? I'm not being a smart___, just confused. I've been suffering through MS changes from Access 2 on up!
Frank
I've done this by keeping the current highest number in a table (by itself). When I have to insert a new record, I read the table, increment the number, use it for the new record and save it back to the table. Or you could use a count query to determine the current number of records.
Of course...
Is there a way to pass the key to a form (and use it to set the records available in the opened form) in ADO style? All the solutions I've seen (Including the help in Access) require the old DAO references and libraries.
Frank
Here is an enhanced implementation of the Zend chained selectors class. Selection from the first list populates the 2nd list. Selection from the 2nd list returns the value. The example also has a button which can be used if you don't want the immediate return from the 2nd selection. Some of the...
That got it! Thanks!
I guess IE assumed the ID was the same as the name. I've spent many hours revamping my CSS and HTML to get it to work in Firefox. So far, all were problems I created and IE masked! And often where I fudged to compensate for what IE did to try and fix my mistakes...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.