Loading deldbe

This forum is for general support of Xbase++
Post Reply
Message
Author
bobvolz
Posts: 114
Joined: Sun Jan 31, 2010 11:25 am

Loading deldbe

#1 Post by bobvolz »

I am trying to import a text file using dbimport() I am first trying to load the deldbe as follows.

DBELOAD( "DELDBE" )

What in the heck am doing wrong. The deldbe.dll file is in the same directory so I know it can find it.

I have include statements for dll.ch, deldbe.ch along with every other .ch I can find.

I get the following error.

ERROR OBJECT:
------------------------------------------------------------------------------
oError:args :
-> VALTYPE: C VALUE: DELDBE
oError:canDefault : Y
oError:canRetry : N
oError:canSubstitute: N
oError:cargo : NIL
oError:description : Invalid DLL name for DBE
oError:filename :
oError:genCode : 52
oError:operation : DbeLoad
oError:osCode : 0
oError:severity : 2
oError:subCode : 8009
oError:subSystem : BASE
oError:thread : 4
oError:tries : 0

Any help would be appreciated.
Bob Volz

User avatar
RDalzell
Posts: 205
Joined: Thu Jan 28, 2010 6:57 am
Location: Alsip, Illinois USA

Re: Loading deldbe

#2 Post by RDalzell »

Hi Bob,

Look at Roger's example in Samples\Csv. I used this as a jump off point for my import routines and it works very well.
If there is anything specifically which I can assist you with, please let me know.

Best regards,

Rick

bobvolz
Posts: 114
Joined: Sun Jan 31, 2010 11:25 am

Re: Loading deldbe

#3 Post by bobvolz »

Thanks Rick
I will try it out.

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: Loading deldbe

#4 Post by rdonnay »

Bob -

You may find that the DELDBE is already loaded if you are linking in DCLIP1.LIB to your app because this loads all the Dbes in an INIT PROC. Xbase++ gives an error if you try to load a DBE more than once.

You may also try DbeLoad("DELDBE',.F.)

I always use the 2nd parameter.

Roger
The eXpress train is coming - and it has more cars.

bobvolz
Posts: 114
Joined: Sun Jan 31, 2010 11:25 am

Re: Loading deldbe

#5 Post by bobvolz »

Thanks Roger and Rick;
I took Rick's advice and tried the csvimp program from the samples\csv directory. It works great with one exception. It will not import the csv file I am getting directly from the internet. I first have to go into excel and save the csv file as a 'dos csv' file for the cdvimp program to read it. I don't know why. The files look identical. I put some tracer code in the import function and it does open the file and get a handle but it does not import the records from a file directly downloaded. Have you ever encountered that.?
The csvimp program is going to be a big help. Thank you Roger and Rick.

User avatar
RDalzell
Posts: 205
Joined: Thu Jan 28, 2010 6:57 am
Location: Alsip, Illinois USA

Re: Loading deldbe

#6 Post by RDalzell »

Bob,

Sounds like an end of file issue.

See:

http://www.csvreader.com/csv_format.php

Rick

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Loading deldbe

#7 Post by skiman »

Hi Bob,

If Rick is correct (yes, can happen :D ), maybe the following can help.

Code: Select all

...
abomemowrite("filename.csv",memoread("filename.csv"))
...

function abomemowrite(cTargetFile,cBuffer)
******************************************
Local nTarget := FCreate( cTargetFile, FC_NORMAL )
if nTarget == -1
    return .F.
  else
    FWrite( nTarget, cBuffer)
    FClose(ntarget)
endif 
return .T.
Best regards,

Chris.
www.aboservice.be

bobvolz
Posts: 114
Joined: Sun Jan 31, 2010 11:25 am

Re: Loading deldbe

#8 Post by bobvolz »

Thanks Chris, I will try that. Roger was right as well. I took out the dbeload and the dbimport works fine.
Thank you all. The beers on me next time we meet. Hopefully soon.
Bob Volz

Post Reply