Guest_imported
New member
- Jan 1, 1970
- 0
Hi, all,
I'm new to SQL. I'm using a Visual Basic front end to a Jet Database, and am trying to use the VisData application provided with Visual Basic to produce recordsets on which I can work manually. I cannot use the Query Design option if I open the database in Access, since the database is too old. I cannot upgrade the database, as it will not then be useable with my Visual Basic front-end application. I think I'm in the right forum!
I can write queries using either of the tables in the code below, and can update fields in existing records at will in the resultant recordsets. However, although the code below does exactly as required in terms of displaying records from both tables, I cannot update any fields. Records from both tables are joined and displayed (one-to-many relationship) in the resultant recordset.
SELECT
Item.`ItemName`, Item.`Cat`,
Lot.`LotName`, Lot.`Exp`, Lot.`Rec`, Lot.`Quant`,
Lot.`Stock`
FROM
`Item` Item INNER JOIN `Lot` Lot ON
Item.`ItemNum` = Lot.`LinkNum`
WHERE
Item.`Show` = 1 AND
Item.`Type` = 2
ORDER BY
Lot.`LinkNum` ASC
The documentation I have been able to find suggests that I should be able to edit all updatable fields, even with joined tables. All of the fields in the SELECT statement are updatable, and the object is a Table Type object, as opposed to a Snapshot. Incidentally, the code was adapted from the SQL view in Crystal Reports 7.0 Pro. Can anyone explain or suggest what the problem is? Many thanks in advance to respondents, and to forum organisers for a great resource,
Johnny Jebel
I'm new to SQL. I'm using a Visual Basic front end to a Jet Database, and am trying to use the VisData application provided with Visual Basic to produce recordsets on which I can work manually. I cannot use the Query Design option if I open the database in Access, since the database is too old. I cannot upgrade the database, as it will not then be useable with my Visual Basic front-end application. I think I'm in the right forum!
I can write queries using either of the tables in the code below, and can update fields in existing records at will in the resultant recordsets. However, although the code below does exactly as required in terms of displaying records from both tables, I cannot update any fields. Records from both tables are joined and displayed (one-to-many relationship) in the resultant recordset.
SELECT
Item.`ItemName`, Item.`Cat`,
Lot.`LotName`, Lot.`Exp`, Lot.`Rec`, Lot.`Quant`,
Lot.`Stock`
FROM
`Item` Item INNER JOIN `Lot` Lot ON
Item.`ItemNum` = Lot.`LinkNum`
WHERE
Item.`Show` = 1 AND
Item.`Type` = 2
ORDER BY
Lot.`LinkNum` ASC
The documentation I have been able to find suggests that I should be able to edit all updatable fields, even with joined tables. All of the fields in the SELECT statement are updatable, and the object is a Table Type object, as opposed to a Snapshot. Incidentally, the code was adapted from the SQL view in Crystal Reports 7.0 Pro. Can anyone explain or suggest what the problem is? Many thanks in advance to respondents, and to forum organisers for a great resource,
Johnny Jebel