On Mon, Jan 24, 2011 at 10:40 AM, James E Harvey <[email protected]> wrote:
> I'm trying to insert records into a table on the ms sql godaddy database,
> but this isn't working.  Does anyone have any advice as to what I'm doing
> wrong?
>
> m.lcxn=("Driver={SQL Server};
> Server=hanovershoefarms.db.6386843.hostedresource.com;
> Database=hanovershoefarms; Uid=hanovershoefarms; Pwd=r5V0n18")
>
> m.lih=Sqlstringconnect(m.lcxn)
>
> lc_selectcommand =      "SELECT * into hsf_broodmares FROM
> c:\foxdat\hsf_broodmare"
>
> SQLExec(m.lih,lc_selectcommand)
----------------------------------------------------

Can't do that.

Quick list of why not.
1) This is executing on a server that is outside of your network.
2) the path C:\foxdat doesn't exit on the SQL Server.
3) You would not have rights to the C:\ on the Godaddy server anyway.
4) Not sure about your account but on my GoDaddy accounts I do NOT
have access to the SQL Server data outside of a application running on
GoDaddy's web environment.
5) In SQL Server the SELECT INTO statement is used to create a
make-table query. It is especially useful for making backup copies of
tables and reports, or for archiving records.
6) You will need an insert into :
INSERT INTO Residents (Name, Occupation)
    SELECT Name, Occupation FROM Immigration
    WHERE Residency = 'granted';
7) That data needs to be there already in SQL Server for this.


>From VFP you could iterate through the results of :
SELECT *  FROM c:\foxdat\hsf_broodmare into t1

if _Tally>0
scan t1
sql = "Insert into table hsf_broodmare (  <list all columns here > ) values ("

Now add in comma separated values that use ' signs for all CHAR and
DateTime vales.

SQLExec(m.lih,sql)



endscan

endif


-- 
Stephen Russell

Sr. Production Systems Programmer
CIMSgts

901.246-0159 cell

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to