forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

f90sql and excel

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
dmcmillan



Joined: 04 Jul 2006
Posts: 22

PostPosted: Tue Dec 09, 2008 2:55 pm    Post subject: f90sql and excel Reply with quote

Hello,

After successfully using f90sql to interface with .mdb files a while back, I thought it would be pretty straightforward to do the same with excel (reading values from certain columns of excel spreadsheets).

But I am having a spot of bother.

First I bind the column of interest with a variable (ELECTRICITY):

call f90SQLBindCol (StmtHndl, ColNumber, SQL_F_CHAR, ELECTRICITY, f90SQL_NULL_PTR, iRet)

Then a simple fetch statement:

call f90SQLExecDirect(StmtHndl,trim(SQLStmtStr),iRet)
call f90SQLFetch(StmtHndl,iRet)


This is almost identical to the routine I used for the .mdb files but all I get is the error statement: HY010 function sequence error

Can anyone help?

DM
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Fri Dec 19, 2008 11:57 pm    Post subject: Reply with quote

I was hoping to see some comments on this post, as I have purchased f90sql, but not yet used it on a project, as the one I was to use it on did not proceed.

I would be interested in any update on use of f90sql or other methods to access and possibly update information in an excel spreadsheet.

To date, I have been dumping the spreadsheet info to a fixed format .prn file. It would certainly be good to access the .xls file, although my recent data sets are now in much larger .xlsx files.

John
Back to top
View user's profile Send private message
sparge



Joined: 11 Apr 2005
Posts: 371

PostPosted: Tue Dec 23, 2008 11:56 am    Post subject: Reply with quote

I have been refraining from posting as my experience with f90sql was a few years ago, but I don't like to see someone disappointed Smile

I too have successfully used f90 sql to interface with an Access database. Difference from DM is that I wrote new data to the database whereas he read existing data from one. Perhaps that explains why my code is rather more elaborate than his? Perhaps he is not giving code chapter and verse (in which case, let's at least see a full list of calls, in order) but I found there was a bit more to this stuff than "bind and fetch"; in particular, I don't see the statement handle being allocated anywhere ...

DM, whence comes the "error statement"? I made a call to full_sql_error after every other routine I used. Is that how you are getting the error message?

Andy
Back to top
View user's profile Send private message Send e-mail
dmcmillan



Joined: 04 Jul 2006
Posts: 22

PostPosted: Mon Jun 15, 2009 11:11 am    Post subject: belated reply Reply with quote

Hello to those who replied. Sorry its taken me so long to come back to this.

As sparge said its not as simple as my 2 lines of code suggests. You do indeed need to call full_sql_error in order to determine if operations have been successful.

I'm afraid the way I got round this was to ditch the excel interface and use text files as input. Yes, this can be incredibly tediuos. But I was desperate to get the code running.

So I'm afraid I don't have answers to my own problem.

Thanks for responding

DM
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group