WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

LAFFDB (obsolete)
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

An Empty Record Gets Created when Creating New DB

Keywords:   new DB empty record

Question:

Hello, I have just started playing with this extender and noticed that if you create your database, add your columns,save the record and close it, you end up with:
column heading1, column heading2
> ,, <--- an extra line of columns

if you save a record, but add a new database entry, you don't get these lines.

Is this a bug? If not, how should I erase the ,, after I have created my entry?

Here is some sample code - delete the file if it exists! If you uncomment the 2 lines below you get a line with the extra ,,

AddExtender("laffd34i.dll")
handle = dbOpen ("C:\TEMP\A.CSV",1,2,2,0,",","")
ret = dbNameColumn(handle, 1, "TEST1")
ret = dbNameColumn(handle, 2, "TEST2")
ret = dbSave (handle, "C:\TEMP\A.CSV", "")
;ret = dbClose(handle)
;handle = dbOpen ("C:\TEMP\A.CSV",1,2,2,0, ",","")
record = dbMakeNewItem(handle, 1)
ret = dbSetRecordField(handle,record,1,1,"FIELD1")
ret = dbSetRecordField(handle,record,2,1,"FIELD2")
ret = dbSave (handle, "C:\TEMP\A.CSV", "")
ret = dbClose(handle)

Answer:

I believe the logic is that when you create a database, an empty record is created and the "pointer" points at this empty record.

If you save the database before filling in the contents of the empty record, then, yes, you get a empty record where all you can see is the delimiter.


Article ID:   W15053
File Created: 2002:09:05:13:49:20
Last Updated: 2002:09:05:13:49:20