SQLCONNECT 
Author Message
 SQLCONNECT

Hi,

I have this command in my code (with irrelevant bits removed)

cResult = ALLTRIM(gcInitials) + "results"

nCon=SQLCONNECT("ufba_connection")

 nCheck = SQLEXEC(nCon,"select count(*) as qcount from servicerecord where ;
     [Brigade Code]=?m.brigade and ;
     [Member Code]=?m.ufba_code and ;
     [From Date]=?m.from_date",cResult)

cResult equates to values such as smresults etc

The problem

When running the .exe (or the .app in VFP) I get a syntax error in the
SQLEXEC command. When the cResult is removed the syntax goes away. However,
the code is OK when run in the command window and the result is put into a
smresults cursor.

The question

Why ?

or

The reason I am using the cursor command is that this is a multi-user
system. Do I need that part of the command, or will VFP take care of it for
me ? (i.e. The app will run on a server but will the cursor be created
locally and therefore be unique to the user)

Cheers

Steve



Wed, 15 Sep 2004 13:15:43 GMT  
 SQLCONNECT
Steve,

The resulting cursor is always created on the client machine in the same way
as the results of an SQL Select command. If you don't include a cursor name,
the default is SQLResult.

I just did a selection from an SQL database I use and here is what I got
with

? DBF("SQLResult")
*!* C:\DOCUME~1\CINDY\LOCALS~1\TEMP\5W04002Y.TMP

You can see that the cursor is created on the hard drive in the user's temp
directory. This is the default in Windows XP but can be changed in the
Config.FPW.

--

Cindy Winegarden  MCSD, Microsoft MVP

http://msdn.microsoft.com/vfoxpro  http://foxcentral.net


Quote:
> Hi,

> I have this command in my code (with irrelevant bits removed)

> cResult = ALLTRIM(gcInitials) + "results"

> nCon=SQLCONNECT("ufba_connection")

>  nCheck = SQLEXEC(nCon,"select count(*) as qcount from servicerecord where
;
>      [Brigade Code]=?m.brigade and ;
>      [Member Code]=?m.ufba_code and ;
>      [From Date]=?m.from_date",cResult)

> cResult equates to values such as smresults etc

> The problem

> When running the .exe (or the .app in VFP) I get a syntax error in the
> SQLEXEC command. When the cResult is removed the syntax goes away.
However,
> the code is OK when run in the command window and the result is put into a
> smresults cursor.

> The question

> Why ?

> or

> The reason I am using the cursor command is that this is a multi-user
> system. Do I need that part of the command, or will VFP take care of it
for
> me ? (i.e. The app will run on a server but will the cursor be created
> locally and therefore be unique to the user)

> Cheers

> Steve



Fri, 17 Sep 2004 05:18:21 GMT  
 SQLCONNECT
Thanks Cindy. I will remove the result cursor part of the command. Does make
you wonder though why it works in the command window but not in the app
itself.

Never mind  :)

Steve


Quote:
> Steve,

> The resulting cursor is always created on the client machine in the same
way
> as the results of an SQL Select command. If you don't include a cursor
name,
> the default is SQLResult.

> I just did a selection from an SQL database I use and here is what I got
> with

> ? DBF("SQLResult")
> *!* C:\DOCUME~1\CINDY\LOCALS~1\TEMP\5W04002Y.TMP

> You can see that the cursor is created on the hard drive in the user's
temp
> directory. This is the default in Windows XP but can be changed in the
> Config.FPW.

> --

> Cindy Winegarden  MCSD, Microsoft MVP

> http://msdn.microsoft.com/vfoxpro  http://foxcentral.net



> > Hi,

> > I have this command in my code (with irrelevant bits removed)

> > cResult = ALLTRIM(gcInitials) + "results"

> > nCon=SQLCONNECT("ufba_connection")

> >  nCheck = SQLEXEC(nCon,"select count(*) as qcount from servicerecord
where
> ;
> >      [Brigade Code]=?m.brigade and ;
> >      [Member Code]=?m.ufba_code and ;
> >      [From Date]=?m.from_date",cResult)

> > cResult equates to values such as smresults etc

> > The problem

> > When running the .exe (or the .app in VFP) I get a syntax error in the
> > SQLEXEC command. When the cResult is removed the syntax goes away.
> However,
> > the code is OK when run in the command window and the result is put into
a
> > smresults cursor.

> > The question

> > Why ?

> > or

> > The reason I am using the cursor command is that this is a multi-user
> > system. Do I need that part of the command, or will VFP take care of it
> for
> > me ? (i.e. The app will run on a server but will the cursor be created
> > locally and therefore be unique to the user)

> > Cheers

> > Steve



Fri, 17 Sep 2004 13:43:58 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Urgent create connection and sqlconnect

2. SQLconnect

3. SQLCONNECT()

4. fatal error with SQLEXEC() and SQLCONNECT()

5. SQLConnect() bug

6. Fatal error in SQLCONNECT()

7. SQLConnect brings up SQL Server Login Dialog

8. SQLCONNECT and the ODBC Pop-Up Login Dialog Box

9. VFP8 SQLConnect() bug

10. SQLCONNECT() Problems

11. SQLCONNECT Problem

12. Fatal Error when connecting to SQL server through SQLCONNECT

 

 
Powered by phpBB® Forum Software