FrançaisEnglishEspañol
PC SOFTForums homeLast messagesOnline repository
PC SOFT
Find...
Perform the searchSearch in...
Newsgroup dedicated to WINDEV (current version), in English
SQLExec error
Dec., 28th 2009 at 09:15 PM
Phil Johnson
<p...@charter.net>


I have a Windev project (My First) that I am trying to get the code behind a button to display info from a SQL query. My project has an analysis attached to a Microsoft Access database. There is a table named Dealers that I wish to open and loop through in the code. Here is what I have so far:

i is int = 0
LocationID is string
SQLText is string

SQLText = "SELECT LocationID From Dealers"
IF NOT SQLExec(SQLText,"QRYTest") THEN Error("Error")
// Retrieve the query line by line
WHILE SQLFetch("QRYTest") = 0
// There is still another line to read
i++
// Retrieve the data
LocationID = SQLGetCol("QRYTest", 1)
Info(LocationID)
END
SQLClose("QRYTest")


When I execute this code I get an error that says "No Current Connection" which seems to imply that I need to create a connection to the Analysis somewhere in the code. The help examples seem to imply that as long as the the table is in the Analysis attached to the project, the connection is implied.

Can anyone help me out with this?

Thanks....