General discussion

Locked

vb 6 DataReport

By sitaminy ·
hi,
I made a database application by VB 6 and I have two problems:
1-I cannot find a way to have one field in my Data report with serial numbers (1,2,3) and in the same time these number should change automaticlly if I add or delete any record
2-I have to messages when I install this application "An error occurred while registering file MSADO20.TLB" and the message for "SIMPDATA.TLB"
please help me

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by wmorgan In reply to vb 6 DataReport

1-Add a field to your table (AutoNumber). It can be used as a primary key and each record will have a unique number.

Maybe these links will help:

http://support.microsoft.com/default.aspx?scid=kb;en-us;299645

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/oledb/htm/oledbpwk_filelist.asp
(Simpdata.tlb ..\Lib IOLEDBSimpleProvider type library)

Collapse -

by ortegahey In reply to vb 6 DataReport

It seems as if your first problem cannot be solved with an autonumeric field. I think you should try with a numeric field, giving it the previous record value + 1, and with a private sub in which it updates all the subsequent records when you delete one.
For example:
private sub UpdateRecords (byval dummynum as integer)
with RsTable
.movefirst
do until .IndexNum = dummynum
.movenext
loop
.delete
do until .eof=true
.edit
.indexnum=indexnum-1
.update
loop
end sub

I think it should work

Collapse -

by puzzle In reply to vb 6 DataReport

Nice work of Ortegahey , but if your serial number assignement order happens to have an incident on your records (maybe you are replacing record) you just have to retrieve the deleted record number and assign it to a new record that replaces the old record otherwise copy and paste Ortegahey's work.

Collapse -

by PJfromOttawa In reply to vb 6 DataReport

I would create an autonumber primary key field and a second field that you use for display purposes that would satisfy your "no gaps" requirement (apply the subroutine to this field). If the application becomes multi-user, this should result in much less (not "no") record contention. The fact that you're re-numbering a field in other records could be an issue if it's multi-user and someone else (or you) has another record open. "It all depends"

Collapse -

by amolj In reply to vb 6 DataReport

Install MDAC setup of proper version for ur second problem

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums