Information générale
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
First time, SQL X 2!
Hey guyz/girlz!
I am back on the threads after a month of holiday!!! Seems like it make 1 year I didn't code anything!!!
I am still on a bug with ADO data control.... Part of it is fixed, another part I can't understand...
A form named frmCustomers contain my customers informations and a command button let me create work orders, another one let me acces the entire list of the work orders of the customer.... On frmCustomer, I have a field containing the amount of work orders for the customer, it is the result of a SQL query sent to frmCustomers.dtWorkOrders....
in frmCreateWorkOrders, I am using this line to initialize my ADOdc :
Set dtWorkOrders.RecordSet = frmCustomers.dtWorkOrders.RecordSet
when I close the frmCreateWorkOrders window I am using this line :
Set frmCustomers.dtWorkOrders.RecordSet = dtWorkOrders.RecordSet
Then I refresh my frmCustomers.dtWorkOrders ADOdc, informations are up to date, everything is ok...
BUT.. look my troubleshooting step, this is where it became weird...
1ST TEST:
Start program in IDE
Look up customer #1 file
Create a work order
Update information on customer file (can see work orders are + 1 in the work order total field)
Open to see list of work orders
dtWorkOrders.RecordSet.RecordCount = 0
Close frmSeeWorkOrders
Reopen frmSeeWorkOrder
dtWorkOrders.RecordSet.RecordCount = 1, and the informations are good for the work order...
Then..
Look up customer #2 file
Create a work order
Update information on customer file (can see work orders are + 1 in the work order total field)
Open to see list of work orders
dtWorkOrders.RecordSet.RecordCount = 1
2ND TEST
Start program in IDE
Look up customer #1 file
Create a work order
Update information on customer file (can see work orders are + 1 in the work order total field)
Look up customer #2 file
Create a work order
Update information on customer file (can see work orders are + 1 in the work order total field)
Open to see list of work orders
dtWorkOrders.RecordSet.RecordCount = 0
Close frmSeeWorkOrders
Reopen frmSeeWorkOrder
dtWorkOrders.RecordSet.RecordCount = 1, and the informations are good for the work order...
Then
Look up customer #3 file
Create a work order
Update information on customer file (can see work orders are + 1 in the work order total field)
Open to see list of work orders
dtWorkOrders.RecordSet.RecordCount = 1
Line used to init dtWorkOrders in frmSeeWorkOrders :
Set dtWorkOrders.RecordSet = frmCustomers.dtWorkOrders.RecordSet
dtWorkOrders.RecordSource = "Select * From workorders Where customer_id="' customer_id$ '" Order By dDate DESC ;"
dtWorkOrders.Refresh
I also tried without the .RecourdSource line...
So.. it seems that the first time ever I am trying to access work orders list, just after I start the program in IDE, frmSeeWorkOrders.dtWorkOrders is not able to catch infos from frmCustomers.dtWorkOrders..
Anyone understand something about that bug ? Is that a Bug??
I am using VS 6.0 SP6, full patched/updated!
Thanks!
Yannick L
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement