Source language: Translate to:

Neobook Database question

Questions about NeoBook PlugIns

Moderator: Neosoft Support

Neobook Database question

Postby stevec » Wed Aug 08, 2007 2:42 pm

I'm working on using a database for an application.
I'm using the NeobookDB 2.3d plugin.
I have the app writing to a txt file on the network. That works fine.
I'm creating a database that imports the txt file [comma delimited] into
the database.
The command that I'm having trouble with is trying to delete all the records, so I can import the text file again.

Here is one of the commands that I'm using;
dbfDeleteAll "F:\PUBLIC\Installs\PCMain.dbf"

Then to update the database;
dbfCreate "F:\PUBLIC\Installs\PCMain.dbf" "Date,Date,0|Time,Time,0|SysName,Memo,0|OS,Memo,0|Version,Memo,0|User,Memo,0|Pagefile,Memo,0|Prefetch,Memo,0|PCleaned,Memo,0|AdminPass,Memo,0|Firewall,Memo,0|GoogleTBR,Memo,0|YahooTBR,Memo,0|Spybot,Memo,0|Contig,Memo,0" ""
dbfImport "F:\PUBLIC\Installs\PCMain.dbf" "F:\PUBLIC\Installs\pcmain.txt"

However the number of records continues to grow, for example if I have 125 records in the database and use the first command to delete them, and repopulate the database, the records now show 250, 125 and the origional 125.

The PCMain.dbt file appears to just keep growing in size.

any ideas?

Much appreciated;
SteveC
Steve Christensen
stevec
 
Posts: 223
Joined: Fri Apr 15, 2005 7:33 am
Location: Boise, Idaho

Postby Neosoft Support » Wed Aug 08, 2007 2:54 pm

I'm not aware of any problems with dbfDeleteAll, but you might also need to pack the database afterwards. For example:

dbfDeleteAll "PCMain.dbf"
dbfPack "PCMain.dbf"

An alternative method of deleting the entire database is to simply delete the file. You can do that from NeoBook using the FileErase action. For example:

FileErase "F:\PUBLIC\Installs\PCMain.dbf"
dbfCreate "F:\PUBLIC\Installs\PCMain.dbf" ...
dbfImport "F:\PUBLIC\Installs\PCMain.dbf" ...
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5603
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Thanks

Postby stevec » Wed Aug 08, 2007 3:00 pm

The dbfPack "PCMain.dbf" worked.

Thanks;
SteveC
Steve Christensen
stevec
 
Posts: 223
Joined: Fri Apr 15, 2005 7:33 am
Location: Boise, Idaho

another quick question

Postby stevec » Wed Aug 08, 2007 3:22 pm

I have several entries that are blank on the date field.
Can I create a query that will delete these records?
Steve Christensen
stevec
 
Posts: 223
Joined: Fri Apr 15, 2005 7:33 am
Location: Boise, Idaho


Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron