Solved

Adding new row in unbound TDB8

Posted on 2004-04-02
8
633 Views
Last Modified: 2007-12-19
Hi experts,

I am using TDBGrid 8.0 and VB6.
My grid is unbound, using an XArrayDB.

I want my grid to show ONE row (add new) when it (the grid) is first opened IF the array is empty.

In the OnInit, RowColChange events, I tried to use the AllowAddNew or the Redim 0,0,0,0 or ReDim 0,1,0,0 but it did not work.

How can I do it ?

Thanks

gallia
0
Comment
Question by:Gallia
  • 4
  • 4
8 Comments
 
LVL 39

Accepted Solution

by:
appari earned 150 total points
ID: 10745222
you first set allowaddnew property of the grid to true.
redim the xarray as follows

xarray.redim 0,-1,0,noofcolumns
or
xarray.redim 0,noofcolumns,0,-1

i am not sure whether the columns are first or rows. test, now i am posting this from my home pc i dont have vb here.
0
 

Author Comment

by:Gallia
ID: 10765742
Hi again,

I tried what you suggested, but it did not work.

I have partially found the solution. The grid showed 2 rows because I was "adding" twice the record. (1- in the xarraydb and 2-in the grid).

BUT, The row still gets added on top, not in the new row. Is it inherent to the grid or is there a way to keep the new record on the new added row ?

Thanks
gallia
0
 
LVL 39

Expert Comment

by:appari
ID: 10765995
>>The row still gets added on top, not in the new row
i am confused. its working on my m/c.
when we enter new record in the new row (with a * mark) and update, the new row is added to xarray. this is normal behaviour of the grid.
0
 

Author Comment

by:Gallia
ID: 10766234
Hi,

Are you saying that after an update, it is normal that the new row (* at the bottom) gets added on top of all rows ?

example
before update
row0
row1
row*

after update
row*
row0
row1

Is that normal behavior for the grid ?
Thanks
gallia
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 39

Expert Comment

by:appari
ID: 10766327
is it is adding new on top?
this is not normal. can you take the screen shot and put it somewhere on the web just i am curious to see it.
0
 
LVL 39

Expert Comment

by:appari
ID: 10766338

did you check on the componentone site for any patches?
0
 

Author Comment

by:Gallia
ID: 10766536
I haven't check the ComponentOne site. I will, but i have the feeling the problem is due to something in the code.

Sorry, I have no place on the web where to put the screenshot.

gallia
0
 

Author Comment

by:Gallia
ID: 10789379
Hi,

I was told by a collegue that this behavior is normal, due to the sort on the recordset.

Thanks a lot  for the help
Gallia

NB: accepted answer xarray.redim 0,-1,0,noofcolumns
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Validating VB6 Function 19 56
SQL VB connection works in one PC and doesn't in another 15 58
Added a column screws up code 5 50
Problem to With line 4 43
Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now