SQLCONNECT(), SQLEXEC() 
Author Message
 SQLCONNECT(), SQLEXEC()

Hi Guys,
    I am having the following problem:
 Platadorms:
  WIndows NT 4
  SQLSERVER 2000
  VFP7
  I have in a form the following :
  con1= SQLCONNECT('MyConnection')
  IF con1 > 0 then
   = SQLEXEC(gnConnHandle,"select * from member","mbr")
  endif

  The connection seems to be Ok, but the SQLEXEC()
returns -2.
  I tryed from command window and did not work eather. It
works Only when I open a view that is connected to SQL
Server Database and try the connection again.
 Am I missing any step to do the SQLEXEC()?

Regards,
Rey



Tue, 30 Aug 2005 04:15:13 GMT  
 SQLCONNECT(), SQLEXEC()
Heya -
make your sqlexec line look like this:
    = SQLEXEC(con1,"select * from member","mbr")

you did not have any connection handle assigned to your gnConnHandle
variable AT ALL, near as I can tell, from reading your code..
hth - mondo regards [Bill]

--
=============================[remove the dot bob to reply]
William Sanders, Electronic Filing Group. MSDN ISV - VFP/SQL .  mySql/ Sql /
Oracle with VFP - YUP!!
972.394.7261 / GoTo China and teach C/SaPPdEV on occasion.
http://window.to/vfoxpro

Quote:
> Hi Guys,
>     I am having the following problem:
>  Platadorms:
>   WIndows NT 4
>   SQLSERVER 2000
>   VFP7
>   I have in a form the following :
>   con1= SQLCONNECT('MyConnection')
>   IF con1 > 0 then
>    = SQLEXEC(gnConnHandle,"select * from member","mbr")
>   endif

>   The connection seems to be Ok, but the SQLEXEC()
> returns -2.
>   I tryed from command window and did not work eather. It
> works Only when I open a view that is connected to SQL
> Server Database and try the connection again.
>  Am I missing any step to do the SQLEXEC()?

> Regards,
> Rey



Tue, 30 Aug 2005 18:10:52 GMT  
 SQLCONNECT(), SQLEXEC()
I made a mistake posting the message. I have a connection
 Plataforms:
   WIndows NT 4
   SQLSERVER 2000
  VFP7
  I have in a form the following :
   con1= SQLCONNECT('MyConnection')
  IF con1 > 0 then
    = SQLEXEC(con1,"select * from member","mbr")
  endif
   The connection seems to be Ok, but the SQLEXEC()
 returns -1.
   I tryed from command window and did not work eather. It
 works Only when I open a view that is connected to SQL
 Server Database and try the connection again.
  Am I missing any step to do the SQLEXEC()?

Quote:
>-----Original Message-----
>Heya -
>make your sqlexec line look like this:
>    = SQLEXEC(con1,"select * from member","mbr")

>you did not have any connection handle assigned to your
gnConnHandle
>variable AT ALL, near as I can tell, from reading your
code..
>hth - mondo regards [Bill]

>--
>=============================[remove the dot bob to reply]
>William Sanders, Electronic Filing Group. MSDN ISV -

VFP/SQL .  mySql/ Sql /
Quote:
>Oracle with VFP - YUP!!
>972.394.7261 / GoTo China and teach C/SaPPdEV on occasion.
>http://window.to/vfoxpro


>> Hi Guys,
>>     I am having the following problem:
>>  Platadorms:
>>   WIndows NT 4
>>   SQLSERVER 2000
>>   VFP7
>>   I have in a form the following :
>>   con1= SQLCONNECT('MyConnection')
>>   IF con1 > 0 then
>>    = SQLEXEC(gnConnHandle,"select * from member","mbr")
>>   endif

>>   The connection seems to be Ok, but the SQLEXEC()
>> returns -1.
>>   I tryed from command window and did not work eather.
It
>> works Only when I open a view that is connected to SQL
>> Server Database and try the connection again.
>>  Am I missing any step to do the SQLEXEC()?

>> Regards,
>> Rey

>.



Tue, 30 Aug 2005 23:32:24 GMT  
 SQLCONNECT(), SQLEXEC()
ah
got it..
make a named system dsn for sql server [see control panel | admin | data or
odbc]
replace the 'myconnection' tag with the NAME of your 'named system dsn'

and it should work..
mine works - like that, all the time...
hth - regards [Bill]

Quote:
> I made a mistake posting the message. I have a connection
>  Plataforms:
>    WIndows NT 4
>    SQLSERVER 2000
>   VFP7
>   I have in a form the following :
>    con1= SQLCONNECT('MyConnection')
>   IF con1 > 0 then
>     = SQLEXEC(con1,"select * from member","mbr")
>   endif
>    The connection seems to be Ok, but the SQLEXEC()
>  returns -1.
>    I tryed from command window and did not work eather. It
>  works Only when I open a view that is connected to SQL
>  Server Database and try the connection again.
>   Am I missing any step to do the SQLEXEC()?

> >-----Original Message-----
> >Heya -
> >make your sqlexec line look like this:
> >    = SQLEXEC(con1,"select * from member","mbr")

> >you did not have any connection handle assigned to your
> gnConnHandle
> >variable AT ALL, near as I can tell, from reading your
> code..
> >hth - mondo regards [Bill]

> >--
> >=============================[remove the dot bob to reply]
> >William Sanders, Electronic Filing Group. MSDN ISV -
> VFP/SQL .  mySql/ Sql /
> >Oracle with VFP - YUP!!
> >972.394.7261 / GoTo China and teach C/SaPPdEV on occasion.
> >http://window.to/vfoxpro


> >> Hi Guys,
> >>     I am having the following problem:
> >>  Platadorms:
> >>   WIndows NT 4
> >>   SQLSERVER 2000
> >>   VFP7
> >>   I have in a form the following :
> >>   con1= SQLCONNECT('MyConnection')
> >>   IF con1 > 0 then
> >>    = SQLEXEC(gnConnHandle,"select * from member","mbr")
> >>   endif

> >>   The connection seems to be Ok, but the SQLEXEC()
> >> returns -1.
> >>   I tryed from command window and did not work eather.
> It
> >> works Only when I open a view that is connected to SQL
> >> Server Database and try the connection again.
> >>  Am I missing any step to do the SQLEXEC()?

> >> Regards,
> >> Rey

> >.



Wed, 31 Aug 2005 05:42:29 GMT  
 
 [ 4 post ] 

 Relevant Pages 

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

2. Updating Form Content prior to a SQLExec or SQLConnect call

3. Urgent create connection and sqlconnect

4. SQLconnect

5. SQLCONNECT()

6. SQLConnect() bug

7. Fatal error in SQLCONNECT()

8. SQLConnect brings up SQL Server Login Dialog

9. SQLCONNECT

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

11. VFP8 SQLConnect() bug

12. SQLCONNECT() Problems

 

 
Powered by phpBB® Forum Software