You have to check for errors after each SQLEXEC (the code is sufficient for debug purposes not for real environment):
Main Topics
Browse All TopicsI have it set up and have been using this for a month now on all sorts of prgs.
but all of a sudden my SQLExec(x,x,x) will not have any data (in my cursor)
it get a connection > 0 so I know I connect.
and my DNS has not changed.
Not sure where else to debug or check...
Any ideas?
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
so what is the best then? I delcare all in variables ::: lnHandle = SQLConnect(lcDNS, lcUser, lcPWD)
then do the sqlexec() so your saying to do what else to verify the right data base? I see it goes the the main but somehow doesn't get to the lib in the AS400? my windows has the ODBC settings ok too.
It depends what is unstable in your configuration. If you are not always connected to the right database then you have to open the database explicitly by:
lnResult = SQLEXEC(lnHandle, "USE YourDatabase")
If you are not always connected to the right server then you have to check the server name after the connection:
lnResult = SQLEXEC(lnHandle, "SELECT @@ServerName", "cServer") && Valid for SQL Server only
etc.
Maybe it would be better for you to build SQL connection string to a variable and use
lnHandle = SQLSTRINGCONNECT(lcConnStr
then you are always connected to to whatever you need without DNS definition. (http://www.connectionstri
So, this is definitely not FoxPro problem and probably not DNS problem (please check the DSN definition again). Somebody could change DB2 settings or access rights.
You have to present your select command and error message in DB2 zone (http://www.experts-exchan
I've been checking solutions for this error message and they are not clear in exact solution, like e.g. this one:
"I had this problem on our development iSeries when I first got here. The
library QSYS2 was not in the system part of the library list..........I have no
idea how or why, it's the way I inherited the system from the person I
replaced. I changed the sys val QSYSLIBL to include QSYS2 and the problem went
away." -- I would try same thing for GSFL but I have no knowledge of AS400.
How do you select the library in DB2? What do you mean by lnDNS="GSFL"? If it is just DSN name assignment than you have to look inside this DSN definition because the DSN name itself has no relation to your library.
DB2 expert would help better, of course.
Business Accounts
Answer for Membership
by: jaymz69Posted on 2009-10-09 at 08:01:29ID: 25535713
It is like it is not connecting to the Library/DNS.
My remote views work...