Solved

Adding new row in unbound TDB8

Posted on 2004-04-02
8
631 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

707 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

12 Experts available now in Live!

Get 1:1 Help Now