Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBEdits not editable

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
I'm having problems editing the results of this query in DBEdits. While I'm not positive, I think it's because of the joins in the query. Are there restrictions on editing datasets in Delphi like there are in Access? Is my problem basically that my query is not updateable?
Code:
[navy][i]// for automatic syntax highlighting see faq102-6487 
[/i][/navy]SQL.Add([teal]'SELECT M.JURNUM, PANELID, LASTNAME, FIRSTNAME, STREET1, STREET2, CITY, STATE,'[/teal] +
    [teal]' ZIPCODE, RTM, CASE WHEN DNPT = '[/teal][teal]'T'[/teal][teal]' THEN '[/teal][teal]'NO'[/teal][teal]' ELSE '[/teal][teal]'YES'[/teal][teal]' END AS DNPT, CASE '[/teal] +
    [teal]'WHEN DNPM = '[/teal][teal]'T'[/teal][teal]' THEN '[/teal][teal]'NO'[/teal][teal]' ELSE '[/teal][teal]'YES'[/teal][teal]' END AS DNPM, EMPNAME, REGTIMEIN, '[/teal] +
    [teal]'REGTIMEOUT, PARTTIME, SUBSTITUTE, OTHER, P.COMMENTS, PUBEMP FROM JMPMAIN M '[/teal] +
    [teal]'LEFT OUTER JOIN JMPPEMPLE P ON M.JURNUM = P.JURNUM '[/teal] +
    [teal]'LEFT OUTER JOIN JMPPEMPLR R ON P.EMPLOYER = R.EMPCODE '[/teal] +
    [teal]'WHERE PANELID LIKE '[/teal] + QuotedStr(FormatDateTime([teal]'YYMMDD'[/teal], StrToDate(PanelDate)) + [teal]'%'[/teal]) + [teal]' ORDER BY PANELID'[/teal]);

Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for database developers:
The Fundamentals of Relational Database Design
Understanding SQL Joins
 
The restriction is placed by the database engine, not the frontend, ie. if you're using an Access database, the limitations are placed by the Jet engine, not Delphi, or MS Access.

Often, queries that include fields from multiple tables are not editable. As a test, trap a section of code performing an Edit and Post within a try..except block, and the exception raised will tell you exactly what the issue is, if any. You can also use this test code to try modifying your SQL query to see at what point you can edit it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top