Hello!
I am using BCB and I really need a help!
I have to fetch the value from each row in a table and I know I have to add a loop,but when I read the buffer-it takes only the firs value in the firs row in the field and I need to take every row value one by one...

void *buffer;
buffer=malloc(N);
IBQuery->FetchAll();

for (int i=0;i<IBQuery->RecordCount;i++) {
IBQuery->FieldByName("STOINOST")->GetData(buffer);
}
How to make moving throw rows?
10X a lot...

Recommended Answers

All 5 Replies

buffer=malloc(N);

Check the malloc format.How it is to be used.

Read the community rules...Post the topic of your query,not something as help or urgent!!!

Hello!
I am using BCB and I really need a help
I have to fetch the value from each row in a table and I know I have to add a loop,but when I read the buffer-it takes only the firs value in the firs row in the field and I need to take every row value one by one...

void *buffer;
buffer=malloc(N);
IBQuery->FetchAll();

for (int i=0;i<IBQuery->RecordCount;i++) {
IBQuery->FieldByName("STOINOST")->GetData(buffer);
}
How to make moving throw rows?
10X a lot...

Well it is not of that because I give the size N and the buffer is fine, but takes only the first value or if I write:
IBQuery->Last();
takes only the last value...
Sorry about the title-a will move and rename my thread

Well I just didn't mean the format when i said to recheck it.

As I know it void * pointer is used in order to typecast one type of pointer to another type. As a matter of fact dereferencing a void * pointer is also an error. Its just used as a mediator for type casting of one pointer type to another.

And here you are trying to assign memory to a void * pointer and trying to use it as a normal array but with type void elements stored within it which as I know is wrong. So I told you to recheck it !!!
Check out here and here for more information.
Same problem faceed here by some other person too.

Well it is not of that-I can`t move around the rows! I check what is in the buffer and every time is the first value of the first row,when I use
IBQuery->Last();
it takes only the last value!
May be I have to use instead of IBQuery->...
DBGrid-> ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.