EDS: bad record number.

new topic     » topic index » view thread      » older message » newer message

Hello, ALL

I'm developed a news engine. 
To show news i'm use this code:

news_size = db_table_size()

for i = 1 to news_size do
    title = db_record_key(i)
    record = db_record_data(i)
    put_item(record, title, i)
end for

and got the error: bad record number.
variables:
   news_size = 20
   i = 2

e.g. 'for' code executed only one count

base created with this code:
if db_create("news.ah", DB_LOCK_NO) != DB_OK then
puts(1, "can't create news.ah")
abort(-1)
end if
if db_create_table("news") != DB_OK then
puts(1, "can't create table _news in news.ah")
abort(-1)
end if
for i = 1 to 20 do
-- insert with random key, for debug only
if db_insert(sprintf("%8d", rand(999999)),{"04.02.2007", "Crazy Coder", "Some
text", "http://www.art-hack.ru"}) != DB_OK then
puts(1, "can't insert initial record")
end if
end for
db_close()



How to fix this error?

Best Regards, Crazy Coder(webmaster at art-hack.ru)

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu