VFP7 application. Need to connect to web service, which is running locally
on the same PC. I have some sample code (I think it's .net) that I need
help converting to VFP for the objSdk and objError objects.

Dim sHandle As String
Dim objSdk As New localhost.SmpSdk
Dim objError As New localhost.clsSdkError
sHandle = objSdk.SdkZLogin (cUser,cPassword, objError)
If (sHandle = "")
MsgBox ("Invalid Login")
Else
MsgBox ("Login Success")
End if

TIA

Re: Localhost by borisb

borisb
Fri Aug 19 05:55:24 CDT 2005

Karen wrote:
>
> VFP7 application. Need to connect to web service, which is running locally
> on the same PC. I have some sample code (I think it's .net) that I need
> help converting to VFP for the objSdk and objError objects.
>
> Dim sHandle As String
> Dim objSdk As New localhost.SmpSdk
> Dim objError As New localhost.clsSdkError
> sHandle = objSdk.SdkZLogin (cUser,cPassword, objError)
> If (sHandle = "")
> MsgBox ("Invalid Login")
> Else
> MsgBox ("Login Success")
> End if
>
> TIA
>
>
>

Try:
LOCAL sHandle, objSdk, objError
sHandle = ""
objSdk = CREATEOBJECT([localhost.SmpSdk])
objError = CREATEOBJECT([localhost.clsSdkError])
sHandle = objSdk.SdkZLogin(cUser,cPassword, objError)
If EMPTY(sHandle)
MessageBox("Invalid Login")
Else
MessageBox("Login Success")
Endif


Re: Localhost by Karen

Karen
Fri Aug 19 10:30:43 CDT 2005

"borisb" <borisb@mail.bg> wrote in message
news:%23dB2CyKpFHA.1416@TK2MSFTNGP09.phx.gbl...
> Karen wrote:
>> VFP7 application. Need to connect to web service, which is running
>> locally on the same PC. I have some sample code (I think it's .net) that
>> I need help converting to VFP for the objSdk and objError objects.
>>
>> Dim sHandle As String
>> Dim objSdk As New localhost.SmpSdk
>> Dim objError As New localhost.clsSdkError
>> sHandle = objSdk.SdkZLogin (cUser,cPassword, objError)
>> If (sHandle = "")
>> MsgBox ("Invalid Login")
>> Else
>> MsgBox ("Login Success")
>> End if
>>
>> TIA
>>
>>
>>
>
> Try:
> LOCAL sHandle, objSdk, objError
> sHandle = ""
> objSdk = CREATEOBJECT([localhost.SmpSdk])
> objError = CREATEOBJECT([localhost.clsSdkError])
> sHandle = objSdk.SdkZLogin(cUser,cPassword, objError)
> If EMPTY(sHandle)
> MessageBox("Invalid Login")
> Else
> MessageBox("Login Success")
> Endif
>

Tried this, but it didn't work. Since the data is stored in SQL, is it
possible to get to it through ODBC or ADO? I'd prefer to do it this way,
but didn't know how to set up the connection for a local server.



Re: Localhost by swdev2

swdev2
Fri Aug 19 13:37:53 CDT 2005

Yo Karen -
you want to get to the sql server on that machine?
try a named system dsn first, in the odbc manager - and test the connection.

then - in vfp - you should be able to get to the sql server on that local
machine (your basic goal, right? screw the SDK for the nonce) via ODBC , try
to make , just for grins and testing, a
database container
with a database connection that points back to
your sql server .
then make a
remote view into a table on the sql server

lemme know how it turns out, ah?
mondo regards [Bill]
--
===================
William Sanders / EFG VFP / mySql / MS-SQL
www.efgroup.net/vfpwebhosting
www.dotnetconversions.com
"Karen" <forjunk2go2@hotmail.com> wrote in message
news:uq#xXWEpFHA.3064@TK2MSFTNGP15.phx.gbl...
> VFP7 application. Need to connect to web service, which is running
locally
> on the same PC. I have some sample code (I think it's .net) that I need
> help converting to VFP for the objSdk and objError objects.
>
> Dim sHandle As String
> Dim objSdk As New localhost.SmpSdk
> Dim objError As New localhost.clsSdkError
> sHandle = objSdk.SdkZLogin (cUser,cPassword, objError)
> If (sHandle = "")
> MsgBox ("Invalid Login")
> Else
> MsgBox ("Login Success")
> End if
>
> TIA
>
>



Re: Localhost by Karen

Karen
Fri Aug 19 14:37:36 CDT 2005

I gotta tell you, I tried that route earlier and wasn't successful. Must
have been a bad day for me, because today it works! And yes, that was my
preferred way to get to the data.

Thanks so much for your help!

"swdev2" <wsanders@dotnetconversions.bob.com> wrote in message
news:esTZYzOpFHA.2504@tk2msftngp13.phx.gbl...
> Yo Karen -
> you want to get to the sql server on that machine?
> try a named system dsn first, in the odbc manager - and test the
> connection.
>
> then - in vfp - you should be able to get to the sql server on that local
> machine (your basic goal, right? screw the SDK for the nonce) via ODBC ,
> try
> to make , just for grins and testing, a
> database container
> with a database connection that points back to
> your sql server .
> then make a
> remote view into a table on the sql server
>
> lemme know how it turns out, ah?
> mondo regards [Bill]
> --
> ===================
> William Sanders / EFG VFP / mySql / MS-SQL
> www.efgroup.net/vfpwebhosting
> www.dotnetconversions.com
> "Karen" <forjunk2go2@hotmail.com> wrote in message
> news:uq#xXWEpFHA.3064@TK2MSFTNGP15.phx.gbl...
>> VFP7 application. Need to connect to web service, which is running
> locally
>> on the same PC. I have some sample code (I think it's .net) that I need
>> help converting to VFP for the objSdk and objError objects.
>>
>> Dim sHandle As String
>> Dim objSdk As New localhost.SmpSdk
>> Dim objError As New localhost.clsSdkError
>> sHandle = objSdk.SdkZLogin (cUser,cPassword, objError)
>> If (sHandle = "")
>> MsgBox ("Invalid Login")
>> Else
>> MsgBox ("Login Success")
>> End if
>>
>> TIA
>>
>>
>
>



Re: Localhost by borisb

borisb
Mon Aug 22 02:41:26 CDT 2005

Karen wrote:
>
> "borisb" <borisb@mail.bg> wrote in message
> news:%23dB2CyKpFHA.1416@TK2MSFTNGP09.phx.gbl...
>
>>Karen wrote:
>>
>>> VFP7 application. Need to connect to web service, which is running
>>>locally on the same PC. I have some sample code (I think it's .net) that
>>>I need help converting to VFP for the objSdk and objError objects.
>>>
>>>Dim sHandle As String
>>>Dim objSdk As New localhost.SmpSdk
>>>Dim objError As New localhost.clsSdkError
>>>sHandle = objSdk.SdkZLogin (cUser,cPassword, objError)
>>>If (sHandle = "")
>>> MsgBox ("Invalid Login")
>>>Else
>>> MsgBox ("Login Success")
>>>End if
>>>
>>>TIA
>>>
>>>
>>>
>>
>>Try:
>>LOCAL sHandle, objSdk, objError
>>sHandle = ""
>>objSdk = CREATEOBJECT([localhost.SmpSdk])
>>objError = CREATEOBJECT([localhost.clsSdkError])
>>sHandle = objSdk.SdkZLogin(cUser,cPassword, objError)
>>If EMPTY(sHandle)
>> MessageBox("Invalid Login")
>>Else
>> MessageBox("Login Success")
>>Endif
>>
>
>
> Tried this, but it didn't work. Since the data is stored in SQL, is it
> possible to get to it through ODBC or ADO? I'd prefer to do it this way,
> but didn't know how to set up the connection for a local server.
>
>
>

Try this to connect to SQL Server:
** Change CUSER and CUSERPASS to actuar username and password for
** SQL Server. Also change CDATABASENAME to the name of DB

sqlH = SQLSTRINGCONNECT([DRIVER=SQL Server;UID=CUSER;PWD=CUSERPASS;]+;
[DATABASE=CDATABASENAME;SERVER=localhost;])
IF sqlH < 0
AERROR(laErrors)
MessageBox(laErrors[2])
ENDIF