>I need to append some data from SQL Server into a local table. This is my first attempt to become familiar with SQL Server and remote connections so I need a little help. I have successfully created a remote connection to the Server. This connection is named 'TRP_SQL' and is located in a database named 'newsurveys'. The data I want to append is located in a table named 'exported'.
>
>I have been able to create a view using the remote view designer and browse the data but I would prefer to create the view programmatically using CREATE SQL VIEW or some other suitable means. I can't seem to get the syntax right to do the job. Here is what I have:
>
>
>close tables all
>open database "\\tpdfiles\data\dfreeman\trp\data\surveys\newsurveys"
>create sql view tempview connection trp_sql as select * from ...
>select mytable
>append from tempview
>
>
>There seems to be a need for 2 connection parameters, how do you specify the table?
>Can someone help me finish this?
>
>Also, do I deal with the created view the same way as a temporary cursor? Could this be done with an ordinary SELECT instead of a view? etc?
>
>
>Thanks
Don,
You don't need a dbc nor a view for this. You can use ODBC/OLEDB instead. ie:
lcConnectionString = "Driver=SQL server;server=.;Trusted_connection=yes"
lnHandle = SqlStringConnect(m.lcConnectionString)
SQLExec(m.lnHandle,"select * from myDatabase..myTable","resultCursor")
SQLDisconnect(m.lnHandle)
select resultCursor
browse
Cetin