Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: rupesh sharma
  Where is rupesh sharma?
 jaipur
 India
 rupesh sharma
 To: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Canada
 Pete Sass
 Tags
Subject: RE: local and remote views
Thread ID: 365506 Message ID: 365570 # Views: 63 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Friday, December 28, 2012 6:21:06 AM         
   


sir thank your very much for your detailed and simple but powerful reply.
i have a problem. actually i want to use a database hosted at my webserver and using by my website.
now i want to update data in that database from my vfp application.

is it possible?
if yes then how to do that? any idea about connection for this. (i have server name like mssql32.cp.... and port 1433 with database created at web server)

thanks in advance







> > hi,
> > what is the difference between local views and remote views?
> > if i enter data in view (in both) it will stored in table or not?
> > how to use remote views?
> > please provide some study material also.
> > thanks in advance
> > Rupesh Kumar Sharma
> > Dhanisha Infotech
> > Jaipur, India
>
>
> Hi,
> If you are connecting into some other database backend such as MySql or
> Microsoft SQL Server I avoid using remote views.
> I prefer SPT... that is SQL Select statements using:
>
> CREATE THE CONNECTION FROM VFP TO THE DATABASE BACKEND
>
* --- Default connection always creates a shared connection.
> lnSQLConn = SQLStringConnect("Driver=SQL Server;Server=ServerName\DBInstanceName;UID=UserID;PWD=Password;
> Database=Databasename")
> 
> * --- Test that the connection completed successfully.
> IF lnSQLConn <= 0
>   = MESSAGEBOX("Connection to the SQL Server database failed at: " + TRANSFORM
>   (DATETIME()) + "." + CHR(13) + "This application will automatically
>   close down.",0+16,"DATABASE - Connection Failure")
>   * --- Clear event processing and return the user to Windows OS.
>   CLEAR EVENTS
>   QUIT
> ENDIF

>
> NOW USE SQLEXEC() FUNCTION TO OBTAIN RECORDSET INTO A LOCAL CURSOR
>
nConnRetval= SQLEXEC(lnSQLConn,"Select * FROM Orders WHERE STATUS = 'INPROG' ORDER BY OrderNo","tmpOrders")
> IF nConnRetval < 0
>   = MESSAGEBOX("Obtaining data from the SQL Server database failed at: " +  
>   TRANSFORM (DATETIME()) + "." + CHR(13) + "Problems may exist with the  
>   system.",0+16,"QUERY - Failure")
>   * --- Clear event processing and return the user to Windows OS.
>   CLEAR EVENTS
>   CLOSE ALL
>   QUIT
> ENDIF

>
> Also read up on cursor adapters. Both cursor adapters and SPT provides you far
> more easily configured granulartity and control over what is coming down the network
> to you at each workstation.
>
> Pete "the IceMan", from the Great White North of Canada.
> www.marathongriffincomputers.com
> Home of the Canadian and US download for Chen's VFP C++ Compiler
> http://www.marathongriffincomputers.com/VFP-C++-Compiler.html



Rupesh Kumar Sharma
Dhanisha Infotech
Jaipur, India

ENTIRE THREAD

local and remote views Posted by rupesh sharma @ 12/27/2012 12:37:17 PM
RE: local and remote views Posted by Manish Swami @ 12/27/2012 1:06:23 PM
RE: local and remote views Posted by Michel Levy @ 12/27/2012 2:01:41 PM
RE: local and remote views Posted by Pete Sass @ 12/27/2012 5:12:06 PM
RE: local and remote views Posted by rupesh sharma @ 12/28/2012 6:21:06 AM
RE: local and remote views Posted by anand kulkarni @ 12/28/2012 7:15:59 AM
RE: local and remote views Posted by Pete Sass @ 12/28/2012 11:05:03 AM
RE: local and remote views Posted by Anders Altberg @ 12/30/2012 6:41:13 PM
RE: local and remote views Posted by tom knauf @ 1/3/2013 11:41:00 AM