vb6 adodc delete
-
i am using following code in vb6 Private Sub cmdDelete_Click() On Error GoTo DeleteErr With datPrimaryRS.Recordset .Delete .MoveNext If .EOF Then .MoveLast End With Exit Sub DeleteErr: MsgBox Err.Description End Sub but it give error: Insufficient key column information for updating or refreshing. it remove the data from datagrid but not from ms access database please help me battan20@gmail.com
-
i am using following code in vb6 Private Sub cmdDelete_Click() On Error GoTo DeleteErr With datPrimaryRS.Recordset .Delete .MoveNext If .EOF Then .MoveLast End With Exit Sub DeleteErr: MsgBox Err.Description End Sub but it give error: Insufficient key column information for updating or refreshing. it remove the data from datagrid but not from ms access database please help me battan20@gmail.com
hi Amit Battan Ror Have you initiated a Development in vb6? If so,VB6 its Dead incase you dont know. Try to learn C# or vb.net.If your Company is Still Planning to keep vb6 apps and you have to maintain them, start sending out your resume because you are going to kill your skills. Now lets get back to your error.To update a Database record.. the Server has to know exactly which record it is that you want to change.. ie. it needs a UNIQUE key of some kind to process the record. IF in your DataBase table you do NOT define a field as being unique, ADO will look at the data and then try to build a (temporary)UNIQUE key.. which then can be used to perform the update. Sometimes ADO is successful in doing this.. and sometimes it is NOT (as witnessed by your present dilemna).The first thing you should do is go and check the Tables you are using to make sure that each of them has at least ONE unique field defined.. and if there is none.. add a Unique identifyling field (such as an Autonumber) to it. Hope it helps
Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za
-
i am using following code in vb6 Private Sub cmdDelete_Click() On Error GoTo DeleteErr With datPrimaryRS.Recordset .Delete .MoveNext If .EOF Then .MoveLast End With Exit Sub DeleteErr: MsgBox Err.Description End Sub but it give error: Insufficient key column information for updating or refreshing. it remove the data from datagrid but not from ms access database please help me battan20@gmail.com
Go to the table that you want to Update and make sure that there is a Primary_key, What database are you using?, Send me a Structure and will help you.
Vuyiswa Maseko, Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding VB.NET/SQL7/2000/2005 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@tshwane.gov.za