
Multi Table Recordset Problem (Not Solved)
Hi,
****************************************************************************
*************
* Note: I don't want to Add Records in ItemMas becuase a Record Already
* * Exist in that Table.
*
****************************************************************************
*************
I am using following.
1. VB6
2. Microsoft ActiveX Data Object 2.1 Library
3. Access 2000
I am generating recordset from two tables and providing that recordset to
DataGrid to Adding/Editing/Deleting etc.
My Table are as follows.
Table Name Primary Key Relationship
1. ItemMas, ItemCode one
2. InvoiceProduct DocumentNo+Sno Many
My Recordset Property are as follows.
RsInvoiceProduct.CursorLocation = adUseClient
RsInvoiceProduct.CursorType = adOpenDynamic
RsInvoiceProduct.LockType = adLockBatchOptimistic
I am Generating recordset with following SQL command.
"SELECT InvoiceProduct.DocumentNo, InvoiceProduct.SNo,
InvoiceProduct.ItemCode, ItemMas.ItemName, ItemMas.Unit, InvoiceProduct.Qty,
InvoiceProduct.Rate, InvoiceProduct.Per, InvoiceProduct.Amount FROM ItemMas
INNER JOIN InvoiceProduct ON ItemMas.ItemCode = InvoiceProduct.ItemCode
WHERE InvoiceProduct.DocumentNo=' " & Me.DocumentNo & " ' "
Where Me.Document No. is Variable and it value contain anything like
"0000001" etc.
****************************************************************************
*************
* Note: I don't want to Add Records in ItemMas becuase a Record Already
* * Exist in that Table.
*
****************************************************************************
*************
My Problem is as follows.
1. When User is Entering Item Code through DataGrid then the Value of
ItemName & Unit Field of Recordset is not populated automatically.
If I want to Populate automatically is there any method.
2. After Entering detail by DataGrid when I tried to Use "UpdateBatch"
method then it Gives following message.
"Index or Primary Key value should not be blank."
If I use recordset only from one table it is working fine.
I tried to Use ADO Dynamic Property
"Unique Table" = "InvoiceProduct",
"Unique Schema" = "Admin" (Name of Table Owner"),
"Uniq Catalog" = "db1.mdb"
then I receive error message
"Non-existent or under-specified UNIQUE TABLE."
In ADO help they have not given example how to set Property of
Recordset.
Please help me.
Sanjay Shah