Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create remote view
Message
 
To
12/09/2006 01:26:23
Joel Hokanson
Services Integration Group
Bellaire, Texas, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01152922
Message ID:
01152941
Views:
19
This message has been marked as the solution to the initial question of the thread.
>If I have a table name from an SQL database, can I make a remote view with a program instead of having to define it manually in a DBC?
>
>For example if table name was theusers in SQL database mydata.
>
>I want to create a remote view of all fields in table theusers. It can be a read only view, I just want to be able to browse or copy the table.

You can, but there is a easier ways to accompilsh this. If you want the resulted cursor not to be updatable you could use SPT to get data. Other easier way is to use CursorAdapter class.

Here an example how to get data from SQL server using SPT
** Becuase you want a remote view I assume that you already have a connection to SQL Server
** If you didn't have one check SQLSTRINGCONNECT() and SQLCONNECT() in HELP
** let the connection handler have name lnSQL

IF SQLEXEC(lnSQL,[SELECT * FROM TheUsers],[crsTheUser]) < 0
   AERROR(laError)
   MessageBox([Can't get the records from table TheUsers ]+laError[1,2]
   RETURN
ENDIF
SELECT crsTheUser
BROWSE NORMAL
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform